内容显示页
 
类别:搜索引擎+SEO | 浏览(149) | 2007-5-24 0:09:51

网站索引终于好看点了,不是一片了,我看过Z-blog的索引方法,只是简单的left(),哪果一文章里有各种标签,比如像我这样的网站,那肯定是不行的。网站整个都会变形的。

html没有专门学过,今天看到一个

 <ol>
<li>www.yongfa365.com</li>
<li>www.yongfa365.com</li>
</ol>
看到的效果就是前边带数字的列表。

还有以前知道的但不常用的一个<pre></pre>

这个可以保证你的内容原样显示。有回车还是有回车,而不是成了一片

还有另外一个就是关于截取有html代码的前多少个字的代码里正则可以这么写

<%
'截取带有html代码的前N个字符'原创:柳永法(yongfa365)'Blog
Function getHTMLContent(NO, txtContent) If Len(txtContent)<= NO Then getHTMLContent = txtContent Exit Function End If Dim regEx, Match, Matches, s, E ' 建立变量。 Set regEx = New RegExp ' 建立正则表达式。 regEx.IgnoreCase = True ' 设置是否区分字符大小写。 regEx.Global = True ' 设置全局可用性。 patrn = "<p|<br|<li|<table" patrn = Split(patrn, "|") For Each p in patrn regEx.Pattern = p ' 设置模式。 txtContent = regEx.Replace(txtContent, "||" & p ) Next txtContent = Split(txtContent, "||") For Each E in txtContent If Len(s)>NO Then Exit For s = s + E Next getHTMLContent = s End Function %>

引用本页地址:http://www.yongfa365.com/item/dc4a220071670a16.html
 
 
相关链接
 
网友评论:
1 airzen - 2007-11-23 0:15:58
Public Function FilterHtml(str)
Dim regEx
'创建正则对象
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.MultiLine = True

regEx.Pattern = ""
FilterHtml = regEx.Replace(str,"")
Set regEx = Nothing
End Function
详见本网站
http://www.haixiait.com/article.asp?id=81
 
2 yongfa365 - 2007-11-23 19:56:04
呵呵,我想要的是截取后还是带html的,并不是不要html了
 
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片看不清? 换张图试试
 
   
 
 
文章分类
 
 
专题(3)
 
ASP+VBS(141)
 
 
 
 
Linux(10)
 
 
SQL(55)
 
web 2.0(21)
 
 
 
 
 
 
心程(48)
 
生活(71)
 
创业(5)
 
   

power by :柳永法(yongfa365)'Blog | model by :hibaidu | css by:众网友 | 京ICP备07011491号   我要统计  

本空间赞助商:北京中科兴联信息技术有限公司

QQ:64049027    E-mail:64049027<at>qq.com