dracoblue.net

htmlspecialchars_decode for Mootools

This is a short function for Mootools decoding a string containing html entities to text.

function htmlspecialchars_decode(text)
{
	var stub_object = new Element('span',{ 'html':text });
	var ret_val = stub_object.get('text');
	delete stub_object;
	return ret_val;
}

Remember that you usually have no use for that function, because every element of mootools has a .get('text') function, which does the same.

In JavaScript, Mootools by
@ 2009-02-06, Comments at Reddit & Hackernews