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: document.createTextNode("\u0026");
.
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 @ 3:09 pm
Here's a cleaner line to copy:
http://www.digitalmediaminute.com/reference/entity/index.php
Posted by Aaron Barker on February 23, 2006 @ 3:10 pm
"No HMTL Allowed" added ;)
Posted by Steve on February 23, 2006 @ 3:54 pm
Posted by Stuart Langridge on February 24, 2006 @ 3:33 am
1. http://pixel.recoil.org/cocoa/unicodefontinfo.html
Posted by Richard Rutter on February 25, 2006 @ 5:59 am
Posted by Britney on March 10, 2006 @ 3:36 pm
Posted by Daniel on March 12, 2006 @ 4:59 pm
Comments have been closed for this post.