[Javascript] createTextNode and special characters
Immanuel Normann
normann at dfki.de
Fri May 24 08:33:18 CDT 2002
Hello,
I want to create dynamically text with special characters like ä
Therefore I want to use document.createTextNode('ä');
The following code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function showUml() {
var t = document.createTextNode('ä');
document.body.appendChild(t);
}
</script>
</head>
<body onload='showUml()'>ä
</body>
</html>
should give me the respectiv single symbol onload, but what I see in my
browser (Mozilla 1.0 rc2) is actually the 8-character long text: 'ä'
How could I change this?
(document.createTextNode('ü'); doesn't help
document.createEntityReference('ü'); yields an javascript error)
Thanks for help,
Normann
More information about the Javascript
mailing list