“the j stands for Jealoushood”
about me | blog | facebook profile | linkedin profile | twitter profile | stuff i've done | stuff i like | wordpress plugins

26 February, 2010

How to unescape HTML entities in JavaScript

Filed under: Useful,Web Development — Tags: , , — John @ 10:44 pm

This is one of those routine web development things which you assume is inbuilt, but actually proves quite tedious to find a nice solution to.

Specifically, I am talking about converting something like ' to ‘ or & to & directly in Javscript.
This function does exactly that! Note how it adds a function to the prototype for String, so is called in the following way:

"Hello José".unescapeHtml()

Find the code here: paul schreiber » Blog Archive » JavaScript: how to unescape HTML entities.

18 March, 2009

Excellent tutorial on Javascript arrays

Filed under: Web Development — Tags: , — John @ 12:44 pm

I’ve referred to this so many times I thought it would be good to post it here:

http://blog.xkoder.com/2008/07/10/javascript-associative-arrays-demystified/

Powered by WordPress