<%
'相当于php中的htmlspecialchars()
' Convert special characters to HTML entities.
function htmlspecialchars(someString)
' Critical that ampersand is converted first, since all entities contain them.
htmlspecialchars = replace(replace(replace(replace(someString, "&", "&"), ">", ">"), "<", "<"), """", """)
end function
'相当于php中的htmlspecialchars()
' Convert HTML entities to special characters.
function htmlspecialchars_decode(someString)
htmlspecialchars_decode = replace(replace(replace(replace(someString, "&", "&"), ">", ">"), "<", "<"), """, """")
end function
%>
js中对html编码解码
编码encodeURIComponent()
解码decodeURIComponent()