02.23.2006 - Unicode Lookup
Several folks have contacted me since publishing Alternatives to innerHTML asking how to create special characters with createTextNode.
If you were to use
document.createTextNode("&"); you will literally get & written to the document rather than the ampersand you are looking for. The answer is to use the Unicode hex value for the character:
I wasn't able to turn up any reasonably useful charts of the codes, so to make this a bit easier I've thrown together a quick application that will do the lookup for you. Just type in the ASCII integer value or the character itself and it will present you with the Unicode hex value.
Posted by Aaron Barker on February 23, 2006 @ 8:09 pm
Here's a cleaner line to copy:
Posted by Aaron Barker on February 23, 2006 @ 8:10 pm
"No HMTL Allowed" added ;)
Posted by Steve on February 23, 2006 @ 8:54 pm
Posted by Stuart Langridge on February 24, 2006 @ 8:33 am
Posted by Steve on February 24, 2006 @ 3:07 pm
Posted by Richard Rutter on February 25, 2006 @ 10:59 am
Posted by Britney on March 10, 2006 @ 8:36 pm
Posted by Daniel on March 12, 2006 @ 9:59 pm
Comments have been closed for this post.