su***************@gmail.com wrote:
var txt=document.createTextNode(' text');
Character entity references are defined by and in SGML-based markup
languages, not by and in programming languages like JS. Furthermore,
the above would not refer to a space character but to a "no-break space"
character in an SGML-based markup language. So you are looking either
for the space character
var txt = document.createTextNode(' text');
or the "no-break space" character, which would be either
var txt = document.createTextNode('*text');
(I am sending this in ISO-8859-1 encoding, so any ISO-8859-x encoding
should do) or
var txt = document.createTextNode('\xA0text');
or
var txt = document.createTextNode('\u00A0text');
Since escape sequences are more obvious, I suggest you use the latter.
Unicode escape sequences (`\u1234') are supported since JavaScript 1.3
(NN 4.06, 1998), probably since JScript 5.0 (IE/5.0 for Windows, March
1999), and all ECMAScript implementations (conforming to ECMA-262 of
June 1997).
PointedEars