当前位置: 代码迷 >> ASP >> asp中过滤html代码解决方法
  详细解决方案

asp中过滤html代码解决方法

热度:121   发布时间:2012-03-21 13:33:14.0
asp中过滤html代码
请教,如何过滤.网页中的html
代码.
用网页文本编辑器提交的内容
.如何实显首页调用时不显示html的内容.

高手指教.  

<%=left(rs( "jsyd "),200)%>

------解决方案--------------------
<%
Function RemoveHTML( strText )
Dim RegEx

Set RegEx = New RegExp

RegEx.Pattern = " <[^> ]*> "
RegEx.Global = True

RemoveHTML = RegEx.Replace(strText, " ")
End Function
%>
<%=RemoveHTML(left(rs( "jsyd "),200))%>


  相关解决方案