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, ‘>‘) }
时间: 2024-11-08 04:16:20