嵌入GOOGLE百度搜索代码

本文介绍了一个整合多种搜索引擎的应用,通过简单的界面切换即可实现Google、百度及新浪搜索之间的转换。用户可以根据需求选择不同的搜索引擎进行信息查询。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<div class="part_r_b">
   
   <script language="javascript">
   //搜索
   function go_search()
   {
    var type = document.search_form.type.value;
    if(type=='2')  //百度
    {
     document.search_form.word.value = document.search_form.search_key.value;
     document.search_form.action= "http://www.baidu.com/baidu";
     
     
    }else if(type=='3') //新浪
    {
     document.search_form._searchkey.value = document.search_form.search_key.value;
     document.search_form.action= "http://search.sina.com.cn/cgi-bin/search/search.cgi";
    }else    //google
    {
     document.search_form.q.value = document.search_form.search_key.value;
     document.search_form.action= "http://www.google.com/search";
     document.search_form.method='get';
    }
    
    document.search_form.method='get';
    document.search_form.target= "_blank";
    document.search_form.submit();
   
   }
   
   </script> 
    <form id="search_form" name="search_form">
     <input type="hidden" value="utf-8" name="ie"/>
     <input type="hidden" value="utf-8" name="oe"/>
     <input type="hidden" value="zh-CN" name="hl"/>
     <input type="hidden" value="" name="q"/>
     <input type="hidden" value="" name="word"/>
     <input type="hidden" value="sousouwang_pg" name="tn"/>
     <input type="hidden" value="" name="_searchkey"/>
     <input type="hidden" value="" name="type"/>
     <input type="" onfocus="if(this.value=='请输入关键字')this.value=''" value="请输入关键字" name="search_key" size="10" class="txt"/>     
     <input type="image" class="sbt" value="search" onclick="go_search();return false;" src="/index/images/icon/btn_search02.jpg"/>
     <span>
     <input type="radio" class="rad" checked="checked" onclick="document.search_form.type.value=this.value" value="1" name="search_type"/><img src="/index/images/pic/pic_google.gif"/>
     <input type="radio" class="rad" onclick="document.search_form.type.value=this.value" value="2" name="search_type"/><img src="/index/images/pic/pic_baidu.gif"/>
     <input type="radio" class="rad" onclick="document.search_form.type.value=this.value" value="3" name="search_type"/><img src="/index/images/pic/pic_yahoo.gif"/>
     </span>
    </form>
   </div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值