如果象google一样,以红色显示搜索的关键字?

mikeppsk 2004-11-22 11:14:12
我想在自己的网站上面的搜索结果里面象google一样以红色显示搜索的关键字,请指教,谢谢
...全文
300 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
inanition 2004-11-22
  • 打赏
  • 举报
回复
string = replace(str, "<font color=red>" & str & "</font>")
古侠 2004-11-22
  • 打赏
  • 举报
回复
replace(content,str, "<font color=red>" & str & "</font>")
这个最直观
newskyline 2004-11-22
  • 打赏
  • 举报
回复
支持“正则表达式”
bluecobra 2004-11-22
  • 打赏
  • 举报
回复
replace(content,str, "<font color=red>" & str & "</font>")
DARKNESSFALL 2004-11-22
  • 打赏
  • 举报
回复
用正则表达式
qihboy 2004-11-22
  • 打赏
  • 举报
回复
'用正则表达式突出显示字符串中查询到的单词的函数
Function BoldWord(strContent,word)
dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =true
objRegExp.Global=True

objRegExp.Pattern="(" & word & ")"
strContent=objRegExp.Replace(strContent,"<font color=""#ff0000"">$1</font>" )

Set objRegExp=Nothing
BoldWord=strContent
End Function
flying310 2004-11-22
  • 打赏
  • 举报
回复
用替换函数,在搜索的结果中把搜索到的替换成红色不就行了。
nattyfish 2004-11-22
  • 打赏
  • 举报
回复
string = replace(str, "<font color=red>" & str & "</font>")
「已注销」 2004-11-22
  • 打赏
  • 举报
回复
<%
Response.write replace("好好学习,天天向上", "学习","<font color=red>学习</font>")
%>
lonelydreamsym 2004-11-22
  • 打赏
  • 举报
回复
与楼上的方法相同,例子在www.yoxun.com/sym/
试一下就知道了

28,391

社区成员

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

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