<title>搜索引擎跳转代码 本窗口</title> <form id="form1" name="form1" method="post" action="?"> <label> <input name="k" type="text" id="k" value="" /> </label> <label> <select name="seachid" id="seachid"> <option value="1">百度</option> <option value="2">谷歌</option> <option value="3">搜狗</option> <option value="4">搜搜</option> </select> </label> <label> <input type="button" name="button" id="button" value="给老子搜" onclick="subs();" /> </label> </form> <script> function encode(txts) { mytxts=txts.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"&#x$2;")}); return mytxts; } //alert(rdurl); function subs() { var myid=document.getElementById("seachid").options[document.getElementById("seachid").selectedIndex].value; var txts=document.form1.k.value; var mytxts,urls,rdurl; switch(myid) { case "1": urls="http://www.baidu.com/baidu?&tn=kering&word="+encode(txts); break case "2": urls="http://www.google.com.hk/search?client=aff-cs-360se&forid=1&ie=utf-8&oe=UTF-8&q="+encode(txts); break case "3": urls="http://www.gougou.com/search?search="+txts; break case "4": urls="http://www.soso.com/q?w=s"+encode(txts); break } //alert(urls); <!--window.location.href=urls;--> window.location.href=urls; } </script>
评论已关闭!