Whenever I try to change the html code below to produce the search results
in a frame or new window it always does it always does it in the same
window. I assume the problem is it must be specified in the javascript but
not sure where to start. Can someone show me the correct way in javascript?
thx
<html>
<head>
<title>Quick Search on Multiple Search Engines</title>
<script language="JavaS cript" type="text/javascript">
<!--
var crawlername = new Array("Google", "Yahoo","Altavi sta (Raging)");
var crawleraction = new
Array("http://www.google.com/search?q=","htt p://search.yahoo.co m/bin/search?
p=","http://www.altavista.c om/sites/search/res_text?q=");
function populateCrawler s()
{
var d=0,startcount= 0,option;
for (d=0;d<crawlern ame.length;d++)
{
option = new Option(crawlern ame[d],crawleraction[d]);
document.search .crawler.option s[startcount] = option;
startcount++;
}
}
function initiateSearch( x)
{
var url;
url = x.crawler.optio ns[x.crawler.selec tedIndex].value+x.q.valu e;
self.location.h ref = url;
return (false);
}
//-->
</script>
</head>
<body onLoad="populat eCrawlers()">
<h4 align="center"> Quick Search On Various Search Engines</h4>
<form method="GET" name="search" onSubmit="retur n initiateSearch( this)">
<table summary="Search " width="50%" align="center">
<tr>
<th align="right">S earch:</th>
<th align="left">
<input type="text" name="q" size="10"
maxlength="100" > <i nput type="submit" value="GO">
</th>
</tr>
<tr>
<th align="right">U se:</th>
<th align="left">
<Select name="crawler">
</Select>
</th>
</tr>
</table>
</form>
</body>
</html>
in a frame or new window it always does it always does it in the same
window. I assume the problem is it must be specified in the javascript but
not sure where to start. Can someone show me the correct way in javascript?
thx
<html>
<head>
<title>Quick Search on Multiple Search Engines</title>
<script language="JavaS cript" type="text/javascript">
<!--
var crawlername = new Array("Google", "Yahoo","Altavi sta (Raging)");
var crawleraction = new
Array("http://www.google.com/search?q=","htt p://search.yahoo.co m/bin/search?
p=","http://www.altavista.c om/sites/search/res_text?q=");
function populateCrawler s()
{
var d=0,startcount= 0,option;
for (d=0;d<crawlern ame.length;d++)
{
option = new Option(crawlern ame[d],crawleraction[d]);
document.search .crawler.option s[startcount] = option;
startcount++;
}
}
function initiateSearch( x)
{
var url;
url = x.crawler.optio ns[x.crawler.selec tedIndex].value+x.q.valu e;
self.location.h ref = url;
return (false);
}
//-->
</script>
</head>
<body onLoad="populat eCrawlers()">
<h4 align="center"> Quick Search On Various Search Engines</h4>
<form method="GET" name="search" onSubmit="retur n initiateSearch( this)">
<table summary="Search " width="50%" align="center">
<tr>
<th align="right">S earch:</th>
<th align="left">
<input type="text" name="q" size="10"
maxlength="100" > <i nput type="submit" value="GO">
</th>
</tr>
<tr>
<th align="right">U se:</th>
<th align="left">
<Select name="crawler">
</Select>
</th>
</tr>
</table>
</form>
</body>
</html>
Comment