*****高分求过滤页面内JS的函数*****
请高手提供能够过滤下面内容的函数,先谢了。
<script> ***** </script>
<img src= "javascript:***** ">
<img src= "# " onerror= "***** ">
<img src= "javascript:bla " style= "image1-background: url( 'javascript:bla '); image2-backgroun: url( 'javascript:alert%28test%29 ') ">
就是可以执行的js代码最好都能过滤掉。
------解决方案--------------------str=trim(str)
If IsNull(Str) Then
CheckStr = " "
End if
str=replace(str, "& ", "& ")
str=replace(str, ": ", ": ")
str=replace(str, "= ", "= ")
str=replace(str, " < ", "< ")
str=replace(str, "> ", "> ")
str=replace(str, " ", "  ")
str=Replace(Str, " " " ", "" ")
------解决方案--------------------http://noscript.net/features
------解决方案--------------------function RemoveBad(strTemp) {
strTemp = strTemp.replace(/\ <|\> |\ "|\ '|\%|\;|\(|\)|\&|\+|\-/g, " ");
return strTemp;
}