function html2Escape(str) {
return str.replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];});
}
转载于:https://www.cnblogs.com/cornucopia/p/4142662.html
function html2Escape(str) {
return str.replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];});
}
转载于:https://www.cnblogs.com/cornucopia/p/4142662.html