influxweb
5/1/2012 - 10:55 AM

HTML Entities with jQuery and the Browser

HTML Entities with jQuery and the Browser

var div = $('<div/>');
function encodeEntities(str) {
    return div.text(str).html();
}
function decodeEntities(str) {
    return div.html(str).text();
}