62,271
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>选择搜索引擎进行搜索</title>
</head>
<body>
<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;
}
</script>
</html>
<!-- 集客收集整理 - http://www.jike365.com -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<form action="http://www.baidu.com/baidu" target="_blank" method="get">
<input name="tn" type="hidden" value="baidu"/>
<input type="text" name="word" size="10" value=""/>
<input type="hidden" name="ie" value="gb2312"/>
<input type="submit" value="百度搜索"/>
</form>
<form action="http://www.google.com.cn/search" target="_blank">
<input type="text" name="q" size="10" maxlength="100" title="輸入搜索文字" value=""/>
<input type="submit" name="btnG" title="按下此按鈕開始搜索" value="谷歌搜索"/>
<input type="hidden" name="ie" value="gb2312"/>
<input type="hidden" name="oe" value="gb2312"/>
<input type="hidden" name="hl" value="zh-CN"/>
</form>
<body>
</body>
</html>