Closed
Bug 170486
Opened 23 years ago
Closed 23 years ago
Entities in select box are not interpreted, if created by javascript
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: stamer, Assigned: rogerl)
References
()
Details
On the above URL, you can find a simple script, where the content of
the select boxes is created dynamically. By switching from one button
to the other, corresponding entries in the select box are displayed.
However, entities created by javascript seem not to be interpreted at all.
(the initial display is correct, then click on English, then go back to German)
![]() |
||
Comment 1•23 years ago
|
||
That's correct. The entity syntax is HTML syntax, not JS syntax. In HTML4 (not
XHTML, but this page is not XHTML) the script is _not_ parsed by the HTML parser
and is just passed to the JS engine. If you want non-ascii chars in there you
will need to use the standard JS unicode escapes.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Comment 2•23 years ago
|
||
Marking Verified.
Here is a useful URL for HTML entities:
http://www.htmlhelp.com/reference/html40/entities/latin1.html
It contains this data for the character Ä:
Character Entity Decimal Hex
Latin capital letter A with diaeresis Ä Ä Ä
We can also find this character in the charts at www.unicode.org:
http://www.unicode.org/charts/PDF/U0080.pdf
To write this non-ASCII character in JavaScript, you can use either
of these ASCII escapes for it:
Hexadecimal escape: "\xC4"
Unicode escape: "\u00C4"
You can test these out with these javascript:URLs
javascript: alert("\xC4gypten")
javascript: alert("\u00C4gypten")
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•