网站产品检索实现方法

 前台代码:

<form action="/search" method="get" id="searchBox">

      <td width="10" height="36"><input name="cate" type="hidden" value="0"></td>

      <td width="160">请输入要搜索的产品信息</td>

      <td><input name="keyword" type="text" id="keyword" style="width:100px;" /></td>

      <td><input name="站内搜索" type="button" οnclick="querySite();" value="站内搜索" /></td>

      <td><input name="百度搜索" type="button" οnclick="queryBaidu();" value="百度搜索" /></td>

      <td><input name="谷歌搜索" type="button" οnclick="queryGoogle();" value="谷歌搜索" /></td>

 </form>

// script实现检索功能

<body>

<script language="javascript">

function querySite(){

         //document.getElementById("searchBox").action="http://www.baidu.com/s";

         document.getElementById("searchBox").submit();

}

function queryBaidu(){

         wd = document.getElementById("keyword").value;

         //alert(wd);

         location.target="blank";

         location.href = "http://www.baidu.com/s?wd="+wd+"&tn=bds&cl=3&ct=2097152&si=www.pumpzc.com&s=on";

         //http://www.baidu.com/s?wd=%B2%E2%CA%D4&tn=bds&cl=3&ct=2097152&si=www.pumpzc.com&s=on

 

}

function queryGoogle(){

         wd = document.getElementById("keyword").value;

         //alert(wd);

         location.target="blank";

         location.href = "http://www.google.com/search?domains=www.pumpzc.com&q="+wd+"&sa=%E6%90%9C%E7%B4%A2&sitesearch=www.pumpzc.com&client=pub-6854204841389277&forid=1&ie=GB2312&oe=GB2312&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1&hl=zh-CN";

         //

}

</script>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值