function HtmlEncode(text)
{
return text.replace(/&/g,'&').replace(/'/g,'"').replace(//g,'>');
}
博客展示了一个名为HtmlEncode的函数,该函数用于对文本进行HTML编码,通过替换文本中的特定字符,如将&替换为&等,实现文本的HTML编码处理。
function HtmlEncode(text)
{
return text.replace(/&/g,'&').replace(/'/g,'"').replace(//g,'>');
}
484
7053

被折叠的 条评论
为什么被折叠?