“the j stands for Judge”
about me | wordpress plugins | jQuery 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.

No Comments »

:(

RSS feed for comments on this post. TrackBack URL

Leave a comment