Maison >développement back-end >tutoriel php >JS实现的搜索引擎切换代码
function sch(form){ e=document.sel.sq.selectedIndex; //取选定选项的编号 e=document.sel.sq[e].value; //取选定选项的"value"特征值 k=document.sel.k.value; //取搜索关键字 if(document.sel.k.value==""){ //如果没有填入关键字 alert("请输入关键词!"); //则给出提示 document.sel.k.focus(); //将光标移到输入框 return } //以下根据选择的内容改变window.location属性,进行本窗口导航 if(e=="yah1"){location="http://search.chinese.yahoo.com/search/gb?p="+k;} if(e=="yah"){location="http://search.yahoo.com/bin/search?p="+k;} if(e=="soh1"){location="http://search.sohu.com/cgi-bin/search_main.cgi?txt_keyword="+k+"&page_index=0&catagory=main"} if(e=="tonghua"){location="http://search.tonghua.com.cn/search?p="+k;} if(e=="yo1"){location="http://www.goyoyo.com.cn/gyy/guide/gquery%20GB%20"+k+"?"} if(e=="srsnet"){location="http://www.xibaonpx.com/richina.cgi?query="+k;} if(e=="网易"){location="http:// www.xibaonpx.com /cgi-bin/search.cgi?key="+k;} if(e=="whatsite"){location="http:// www.xibaonpx.com /main/search.cgi?keyword="+k+"&start=0&REXP=OR&x=36&y=15"} if(e=="kimo"){location="http://search.kimo.com.tw/cgi-bin/srchfz.pl?srchcdn=B0&query="+k+"&x=22&y=9"} if(e=="yam"){location="http://www.yam.com.tw/b5/search?k="+k+"&x=9&y=18"} if(e=="excite"){location="http://search.excite.com/search.gw?search="+k;} if(e=="cei"){location="http://infonavi.cei.gov.cn/cgi-bin/searchs.dll?OptionSearchs?Key="+k;} if(e=="ztw"){location="http://search.bj.cninfo.net/go/infoseek?keyword="+k;} if(e=="xlw"){location="http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+k;} if(e=="ssk"){location="http://www.cseek.com/cgi/srchengine.cgi?searchcgi=http%3A%2F%2Fwww.cseek.com%2Fhomepage%2Fcgi%2F&all=yes&sortby=1&searchkey="+k;} }
济南银屑病医院 - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!
|