源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Google和百度、雅虎的站内搜索代码

  • 时间:2020-05-26 15:26 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Google和百度、雅虎的站内搜索代码
对于一个网站来说,使用搜索引擎来进行站内搜索往往比自己编写的站内搜索更高效,并且不占用网站服务器的资源,下面是我搜集到的几个主要搜索引擎(Google和百度、雅虎)的站内搜索代码,使用时只需要将代码里的"www.1sucai.cn"替换成你的网址即可。 <!--Google站内搜索开始--> <form method=get action="http://www.google.com/search"> <input type=text name=q> <input type=submit name=btnG value="Google 搜索"> <input type=hidden name=ie value=GB2312> <input type=hidden name=oe value=GB2312> <input type=hidden name=hl value=zh-CN> <input type=hidden name=domains value="www.1sucai.cn"> <input type=hidden name=sitesearch value="www.1sucai.cn"> </form> <!--Google站内搜索结束--> <!--Baidu站内搜索开始--> <form action="http://www.baidu.com/baidu"> <input type=text name=word> <input type="submit" value="Baidu 搜索"> <input name=tn type=hidden value="bds"> <input name=cl type=hidden value="3"> <input name=ct type=hidden value="2097152"> <input name=si type=hidden value="www.1sucai.cn"> </form> <!--Baidu站内搜索结束--> <!--Yahoo站内搜索开始--> <form action="http://www.yahoo.com.cn/search"> <input type=text name="p"> <input type="submit" value="Yahoo 搜索"> <input type=hidden name=vs value="www.1sucai.cn"> </form> <!--Yahoo站内搜索结束--> 下面是Google和百度的Javascript版的站内搜索代码: <!--Google站内搜索开始--> <script type="text/javascript">  function googlesearch () { var wq=document.getElementsByName("wq")[0].value; var link="http://www.google.com/search?domains=www.1sucai.cn&sitesearch=www.1sucai.cn&q="+wq; window.open(link); } </script> <input type="text" name="wq"/><input type="submit" onclick="javascript:googlesearch()" value="Google 搜索" /> <!--Google站内搜索结束--> <!--Baidu站内搜索开始--> <script language="javascript"> function baidusearch () { var wd=document.getElementsByName("wd")[0].value; var link="http://www.baidu.com/s?si=www.1sucai.cn&cl=3&ct=2097152&tn=baidulocal&word="+wd; window.open(link); } </script> <input type="text" name="wd"/><input type="submit" onclick="javascript:baidusearch()" value="Baidu 搜索" /> <!--Baidu站内搜索结束-->
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部