String.prototype.toHtmlEncode = function() { var str = this; str=str.replace("&","&"); str=str.replace("<","<"); str=str.replace(">",">"); str=str.replace("‘","'"); str=str.replace("\"","""); return str; }
用法
"".toHtmlEncode()
时间: 2024-10-05 15:51:03