---
title: "应用多个查询地址查询"
author: "ydsakyclguozi"
date: "2009-11-03T10:29:38Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2009-11-03T10:29:38Z"
id: 509082
url: "https://52347.iteye.com/blog/509082"
---

search.jsp代码：
<%@page contentType="text/html;charset=GBK"%>
<html>
	<head>
		<title>查询</title>
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
		<link href="/template1/css/Style.css" rel="stylesheet" type="text/css" />


	</head>
	<body>
		<FORM name="searchForm" method="post" target="_blank">
			<table border="0" cellspacing="0" cellpadding="0" class="tool">
				<TR>
					<TD>
						关键字搜索
						<INPUT size="25" name="key" style="font-size: 8pt; height: 20px;">
						&nbsp;												<INPUT type="radio" value="yahoo" name="sousuo">
						雅 虎
						<INPUT type="radio" value="googl" name="sousuo">
						Google
						<INPUT type="radio" value="yahooe" name="sousuo">
						Yahoo
						<INPUT type="radio" CHECKED="true" value="baid" name="sousuo">
						百 度 &nbsp;
						<INPUT type="button" value=" 搜 索 " name=But height="100%"
							onClick="return(search4())">
					</TD>
				</TR>
			</table>
		</FORM>
	</body>
	<script type="text/javascript">      
        function search4() {
        
        for(i=0;i <document.searchForm.sousuo.length;i++)  
        {
	if (document.searchForm.sousuo*.checked && document.searchForm.sousuo*.value=="yahoo") {
		window.open("http://cn.search.yahoo.com/s?p=" + document.searchForm.key.value+"&pid=hp&v=web", "mspg2");
		return;
	}
	if (document.searchForm.sousuo*.checked && document.searchForm.sousuo*.value=="googl") {
		window.open("http://www.google.com/search?hl=zh-CN&inlang=zh-CN&ie=GB2312&oe=GB2312&q=" + document.searchForm.key.value, "mspg4");
		return;
	}
	if (document.searchForm.sousuo*.checked && document.searchForm.sousuo*.value=="yahooe") {
		window.open("http://search.yahoo.com/bin/search?p=" + document.searchForm.key.value, "mspg5");
		return;
	}
	if (document.searchForm.sousuo*.checked && document.searchForm.sousuo*.value=="baid") {
		window.open("http://www1.baidu.com/baidu?tn=sitehao123&word=" + document.searchForm.key.value, "mspg6");
		return;
	}
	}
	return false;
}
 </script>
</html>