标签:replace esc 代码 编码 return log pre ret rip
function htmlEscape(sHtml){ return sHtml && sHtml.replace(/[<>&"]/g, function (c) { return { ‘<‘: ‘<‘, ‘>‘: ‘>‘, ‘&‘: ‘&‘, ‘"‘: ‘"‘ }[c]; }); }
标签:replace esc 代码 编码 return log pre ret rip
原文地址:http://www.cnblogs.com/liqipeng/p/6102201.html