Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] createTextNode and special characters


  • From: javascript@xxxxxxxxxx (Immanuel Normann)
  • Subject: [Javascript] createTextNode and special characters
  • Date: Fri, 24 May 2002 15:33:18 +0200

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('&auml;');
 document.body.appendChild(t);
}
</script>
  </head>
  <body onload='showUml()'>&auml;
  </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: '&auml;'

How could I change this?
(document.createTextNode('&#252;'); doesn't help
document.createEntityReference('&#252;'); yields an javascript error)

Thanks for help,

Normann