On Mar 18, 12:00 pm, Tobie Langel <[email protected]> wrote:
> OK, so to summarize:
>
> 1) TextArea have a value property (as per DOM 2 specs),
> 2) Prototype Element#setValue uses the value property (not the HTML
> value attribute),
> 3) Proper, standard compliant way of doing what OP wants:
>
> textArea.value = content.unescapeHTML();
unescapeHTML is a Prototype.js function that uses innerHTML, so not
strictly standards compliant. If that was the goal, the OP would not
be expecting HTML character entities to be parsed when using them as
the content of a textarea element whose content is tyep DOMstring.
For strict standards compliance, plain text should be used and
appended as a DOM text node (e.g. & should be in the text as plain
&).
If the string contains markup and the OP expects it to be parsed, then
either a textarea element is the wrong element to use, or the text
should be parsed first (as occurs with unescapeHTML and innerHTML)
before being used as the content of the textarea.
[...]
> 5) Possible non-standard shortcut suggest by Rob (Note that setting
> innerHTML on textarea elements is NOT trustable across browsers[1]. I
> do NOT recommend it):
Nor do I in general, but it does the job here.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---