标签:
function HtmlEncode(text) { return text.replace(/&/g, ‘&‘).replace(/\"/g, ‘"‘).replace(/</g, ‘<‘).replace(/>/g, ‘>‘) }
还原:
function HtmlDecode(text) { return text.replace(/&/g, ‘&‘).replace(/"/g, ‘\"‘).replace(/</g, ‘<‘).replace(/>/g, ‘>‘) }
标签:
原文地址:http://www.cnblogs.com/shaoing/p/5358130.html