Google and Baidu, Yahoo site Search Code _ website Application

Source: Internet
Author: User
For a website, using search engines for site search is often more efficient than your own site search, and do not occupy the resources of the Web server, the following is a number of major search engines I have collected (Google and Baidu, Yahoo) in the site search code, use only the code in the " Www.jb51.net "replace it with your URL.

<!--Google Site search started-->
<form method=get action= "Http://www.google.com/search" >
<input Type=text name=q>
<input type=submit name=btng value= "Google Search" >
<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.jb51.net" >
<input type=hidden name=sitesearch value= "Www.jb51.net" >
</form>
<!--Google Site search end-->

<!--Baidu Site search started-->
<form action= "Http://www.baidu.com/baidu" >
<input Type=text name=word>
<input type= "Submit" value= "Baidu Search" >
<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.jb51.net" >
</form>
<!--Baidu Site search End-->

<!--Yahoo Site search start-->
<form action= "Http://www.yahoo.com.cn/search" >
<input type=text name= "P" >
<input type= "Submit" value= "Yahoo Search" >
<input type=hidden Name=vs value= "Www.jb51.net" >
</form>
<!--Yahoo Site search End-->

Here is Google and Baidu's JavaScript version of the site search code:

<!--Google Site search started-->
<script type= "Text/javascript" >
function Googlesearch () {
var wq=document.getelementsbyname ("Wq") [0].value;
var link= "http://www.google.com/search?domains=www.jb51.net&sitesearch=www.jb51.net&q=" +WQ;
window.open (link); }
</script>
<input type= "text" name= "Wq"/><input type= "Submit" onclick= "Javascript:googlesearch ()" value= "Google Search" >
<!--Google Site search end-->

<!--Baidu Site search started-->
<script language= "JavaScript" >
function Baidusearch () {
var wd=document.getelementsbyname ("wd") [0].value;
var link= "http://www.baidu.com/s?si=www.jb51.net&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 search"/>
<!--Baidu Site search End-->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.