The problem is when I want to generate text which will be showed in javascript alert. When it contains entity representation of the characters, text in the message box is escaped and the entity representation is showed. At least in the IE.
The point is, browser doesn't understand entities in JS. Try this:
<html> <body> <script type="text/javascript" language="JavaScript"> alert('Á'); </script> </body> </html>
That's true(ly a problem). I don't know if it is a spec issue, at least I don't understand why the script part is not parsed in the same way like the HTML itself. It's only read as text. The only solution I know is to separate the JavaScript into external files.
I think it is a specification issue: http://www.w3.org/TR/2004/REC-xml-20040204/#syntax
<snip> The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form </snip>
�h, no. This goes in the wrong direction and was not what I meant. Of course you have to escape the both characters to have well-formed XML and HTML. What I meant is the missing conversion of those characters back to & and < in inline JavaScript.
In that way we must to use:
<script type="text/javascript" language="JavaScript"> alert('&Aacute;'); </script>
No, this is wrong. You have all the characters now double escaped. Try to view this in your browser: you will definitely don't get back the expected �. The original "alert('Á');" was correct from an XML POV.
Joerg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
