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 @ 06 Feb 2009

comments powered by Disqus

Recent Files

Advertisement

Recent Dev-Articles

Read recently

About

Blogroll