设为首页
加入收藏
站点地图
首页 | 网站建设 | 杭州FPGA培训班,浙江FPGA培训班,苏州FPGA培训班,昆山FPGA培训班,常州FPGA培训班优化 | 网站推广 | 网络营销 | 网站运营 | 网站策划 | 在线讨论 | 下载中心
您当前的位置:WebSite -> 网站建设 -> 文章内容正文->Google和百度、雅虎的站内搜索代码
 子栏目导航
 热门文章
 相关文章
 

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

作者:佚名  来源:转载  发布时间:2008-8-15 17:10:25  

对于一个网站来说,使用搜索引擎来进行站内搜索往往比自己编写的站内搜索更高效,并且不占用网站服务器的资源,下面是我搜集到的几个主要搜索引擎(Google和百度、雅虎)的站内搜索代码,使用时只需要将代码里的"http://www.mepeixun.com/"替换成你的网址即可。
<!--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="/http://www.mepeixun.com/">
<input type=hidden name=sitesearch value="/http://www.mepeixun.com/">
</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="/http://www.mepeixun.com/">
</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="/http://www.mepeixun.com/">
</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=http://www.mepeixun.com/&sitesearch=http://www.mepeixun.com/&q="+wq;
window.open(link); }
</script>
<input type="text" name="wq"/><input type="submit" value="Google 搜索" />
<!--Google站内搜索结束-->
<!--Baidu站内搜索开始-->
<script language="javascript">
function baidusearch () {
var wd=document.getElementsByName("wd")[0].value;
var link="http://www.baidu.com/s?si=http://www.mepeixun.com/&cl=3&ct=2097152&tn=baidulocal&word="+wd;
window.open(link); }
</script>
<input type="text" name="wd"/><input type="submit" value="Baidu 搜索" />
<!--Baidu站内搜索结束-->
对于一个网站来说,使用搜索引擎来进行站内搜索往往比自己编写的站内搜索更高效,并且不占用网站服务器的资源,下面是我搜集到的几个主要搜索引擎(Google和百度、雅虎)的站内搜索代码,使用时只需要将代码里的"http://fuzishu.web.82758.com/"替换成你的网址即可。
<!--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="/http://fuzishu.web.82758.com/">
<input type=hidden name=sitesearch value="/http://fuzishu.web.82758.com/">
</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="/http://fuzishu.web.82758.com/">
</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="/http://fuzishu.web.82758.com/">
</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=http://fuzishu.web.82758.com/&sitesearch=http://fuzishu.web.82758.com/&q="+wq;
window.open(link); }
</script>
<input type="text" name="wq"/><input type="submit" value="Google 搜索" />
<!--Google站内搜索结束-->
<!--Baidu站内搜索开始-->
<script language="javascript">
function baidusearch () {
var wd=document.getElementsByName("wd")[0].value;
var link="http://www.baidu.com/s?si=http://fuzishu.web.82758.com/&cl=3&ct=2097152&tn=baidulocal&word="+wd;
window.open(link); }
</script>
<input type="text" name="wd"/><input type="submit" value="Baidu 搜索" />
<!--Baidu站内搜索结束-->

 [返回上一页] [打 印] [收 藏]
百度中查看“Google和百度、雅虎的站内搜索代码”相关文章

版权申明:本站网站建设资源来源网络,如有侵犯您的版权,请来Q告知 我们会在24小时内删除!

Copyright © 2008-2010 www.mepeixun.com All Rights Reserved
服务QQ:52466268 邮箱:meipeixun@163.com
备案号:苏ICP备07200130号