Home > php教程 > PHP开发 > Asp clears style, javascript, css code in html

Asp clears style, javascript, css code in html

高洛峰
Release: 2016-11-24 09:24:28
Original
1329 people have browsed it

Asp clears style, javascript, css code in html

<%
Function RemoveHTML(str)
Dim objRegExp, Match,strHTML
if isnull(str) then
str=""
end if
strHTML=str
strHTML=replace(replace(replace(strHTML,vblf,""),vbcr,""),vbcrlf,"")
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<script[^>]*?>.*?</script>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<style[^>]*?>.*?</style>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<. ?>"
strHTML = objRegExp.Replace(strHTML,"")
Set objRegExp = Nothing
RemoveHTML=strHTML
End Function
%>
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template