miércoles, 31 de octubre de 2012

Encode y Decode HtmlEntities


function htmlEncode(value){
    if (value) {
        return jQuery('<div />').text(value).html();
    } else {
        return '';
    }
}
 
function htmlDecode(value) {
    if (value) {
        return $('<div />').html(value).text();
    } else {
        return '';
    }
}

No hay comentarios:

Publicar un comentario