显示html代码时,不显示图片代码
时间:2011-06-13
来源:互联网
我从数据库中读出了一段html代码
如:
<STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>Text messaging: Send and receive short text-only messages on your phone. <BR>POP3/IMAP: Support for web-based email from Yahoo!® Mail, Gmail™, Windows Live® Mail, AOL® etc. <BR><BR><STRONG>Specifications: <BR></STRONG>Technology: GSM/GPRS/EDGE/UMTS <BR>Weight: 5.15 ounces <BR>Talk Time: Up to 5 hours <BR><BR><IMG style="BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000; BORDER-LEFT-COLOR: #000000" border=0 src="http://localhost/ruili/upload/editorfiles/2011.6.13_11.40.0_4335.jpg"><STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>
在显示的这些内容时,因为是要做left(xx,100)的代码从简单介绍,但里面含有的图片我不想显示出来.
怎么在显示时,不显示<img ...>这些呢?
如:
<STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>Text messaging: Send and receive short text-only messages on your phone. <BR>POP3/IMAP: Support for web-based email from Yahoo!® Mail, Gmail™, Windows Live® Mail, AOL® etc. <BR><BR><STRONG>Specifications: <BR></STRONG>Technology: GSM/GPRS/EDGE/UMTS <BR>Weight: 5.15 ounces <BR>Talk Time: Up to 5 hours <BR><BR><IMG style="BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000; BORDER-LEFT-COLOR: #000000" border=0 src="http://localhost/ruili/upload/editorfiles/2011.6.13_11.40.0_4335.jpg"><STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>
在显示的这些内容时,因为是要做left(xx,100)的代码从简单介绍,但里面含有的图片我不想显示出来.
怎么在显示时,不显示<img ...>这些呢?
作者: 99percent 发布时间: 2011-06-13
VBScript code
<% s = "<STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>Text messaging: Send and receive short text-only messages on your phone. <BR>POP3/IMAP: Support for web-based email from Yahoo!? Mail, Gmail?, Windows Live? Mail, AOL? etc. <BR><BR><STRONG>Specifications: <BR></STRONG>Technology: GSM/GPRS/EDGE/UMTS <BR>Weight: 5.15 ounces <BR>Talk Time: Up to 5 hours <BR><BR><IMG style=""BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000; BORDER-LEFT-COLOR: #000000"" border=0 src=""http://localhost/ruili/upload/editorfiles/2011.6.13_11.40.0_4335.jpg""><STRONG>Features:</STRONG> <BR>Android 2.2 OS with Android Market and integration with Google applications <BR>" Set re = New RegExp With re .Global = True .IgnoreCase = False .Pattern = "\<IMG [^\>]+?\>" s = .Replace(s, "") End With response.Write s %>
作者: hookee 发布时间: 2011-06-13
用正则去除所有的html代码
VB code
VB code
'-------------------------------------去除html字符 begin Function RemoveHTML(strHTML) Dim objRegExp, Match, Matches Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True '取闭合的<> objRegExp.Pattern = "<.+?>" '进行匹配 Set Matches = objRegExp.Execute(strHTML) ' 遍历匹配集合,并替换掉匹配的项目 For Each Match in Matches strHtml=Replace(strHTML,Match.Value,"") Next RemoveHTML=strHTML Set objRegExp = Nothing set Matches=nothing End Function '-------------------------去除HTML---END
作者: beyond_me21 发布时间: 2011-06-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28