亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

JS實現(xiàn)同時搜索百度和必應(yīng)的方法

 更新時間:2015年01月27日 14:31:39   投稿:shichen2014  
這篇文章主要介紹了JS實現(xiàn)同時搜索百度和必應(yīng)的方法,可實現(xiàn)在底部的兩個框架中同時顯示兩個搜索引擎的搜索結(jié)果,是非常實用的技巧,需要的朋友可以參考下

本文實例講述了JS實現(xiàn)同時搜索百度和必應(yīng)的方法。分享給大家供大家參考。具體如下:

這里實現(xiàn)同時搜索百度和必應(yīng)的功能,輸入關(guān)鍵字,點擊“搜一下”按鈕,兩個搜索引擎的結(jié)果在同個頁面打開,方便。

將下面這兩個htm文件保存,放在同一個文件夾下,打開第一個文件就可以了。
index.htm的代碼:

復(fù)制代碼 代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>同時搜索百度和必應(yīng)</title>
<meta http-equiv="keywords" content="同時搜索百度和必應(yīng)">
<meta http-equiv="description" content="同時搜索百度和必應(yīng)">
</head>

<!--<body style="text-align: center;">
-->
<frameset rows="30%,70%">
<frame src="keleyi.htm">
</frame>
<frameset cols="45%,45%">
<frame id="baiduFrame" name="baiduFrame" src="images/baidu.jpg"></frame>
<frame id="bingFrame" name="bingFrame" src="images/baidu.jpg"></frame>
</frameset>
</frameset>

<!--<iframe id="baiduFrame" width="49%" height="100%" ></iframe>
<iframe id="bingFrame" width="49%" height="100%" ></iframe>
</body>-->
</html>

第二個的文件名為keleyi.htm

keleyi.htm的代碼如下:

復(fù)制代碼 代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>同時搜索百度和必應(yīng)</title>

<meta http-equiv="keywords" content="同時搜索百度和必應(yīng)">
<meta http-equiv="description" content="同時搜索百度和必應(yīng)">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function $(id) {
return document.getElementById(id);
}
function mixSearch() {
var okeyword = $("keyword");
var oForm = $("searchForm");
//提交給百度,構(gòu)造地址參數(shù)
oForm.action = "http://www.baidu.com/s";
okeyword.name = "wd";
oForm.method = "get";
oForm.target = "baiduFrame";
oForm.submit();
//提交給bing,構(gòu)造地址參數(shù)
oForm.action = "http://hk.bing.com/search";
okeyword.name = "q";
oForm.method = "get";
oForm.target = "bingFrame";
oForm.submit();
}
</script>
</head>

<body style="text-align: center;">
<form action="" id="searchForm" method="get" target="baiduFrame">
<input type="text" id="keyword" name="wd" value="" />
<input type="button" value="搜一下~" onclick="mixSearch();" />
</form>
<hr />

</body>
</html>

希望本文所述對大家的javascript程序設(shè)計有所幫助。

相關(guān)文章

最新評論