ASP搜索关键字,结果关键字的颜色改变,如何实现,求各位大下

daiweizhong 2005-07-12 04:50:57
ASP搜索关键字,结果关键字的颜色改变,如何实现,求各位大下
...全文
139 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jack813 2005-07-12
  • 打赏
  • 举报
回复
楼上的方法简单
amadou 2005-07-12
  • 打赏
  • 举报
回复
replace("关键字","<font color=red>关键字</font>")
daiweizhong 2005-07-12
  • 打赏
  • 举报
回复
谢谢楼上的,我去试一下!
孟子E章 2005-07-12
  • 打赏
  • 举报
回复
i = 1
Set regEx = New RegExp
regEx.Global = True
regEx.IgnoreCase = True
With Response
Set rs = cn.Execute(strSQL)
While Not rs.EOF
strTitle = rs("DTitle")
regEx.Pattern="(("& Request("keyWord") &"))"
strTitle = regEx.Replace(strTitle,"<font color='#ff0000'>$1</font>")
If i Mod 2 = 1 Then
.Write "<tr onmouseover=""this.bgColor='#C1D2EE'"" bgcolor='#FFFFFF' onmouseout=""this.bgColor=document.getElementById('DataGrid1').singleValue"">"
Else
.Write "<tr onmouseover=""this.bgColor='#C1D2EE'"" bgcolor='oldlace' onmouseout=""this.bgColor=document.getElementById('DataGrid1').oldValue"">"
End If
.Write "<td><a target='_blank' href='ShowDetail.asp?id=" & rs("objectGuid") & "'>" & strTitle & "</a></td><td><a target='_blank' href='ShowList.asp?id=" & rs("id") & "'>" & rs("STitle") & "</a></td><td>" & rs("CreateDate") & "</td></tr>"
rs.MoveNext
i = i + 1
Wend
rs.Close
Set rs = Nothing
End With

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧