Forum Moderators: open
Unfortualy if you look at code it only works if keyword is placed a end off search engine url ..
now i wish to add a new search engine but the keyword is not at the end of url .. and search only works if words behind keyword are added ..how can i add the required info at end of keyword .. i must add this: ?=search&ON
this url i wish to add:
[searchengine.com...]
Keyword-here is were keyword goes..
but as you see it requires info behind keyword.
now can i add this or fit this url in bellow script with code after keyword.
im looking forward to your reply
===
<title>Quick Search on Multiple Search Engines</title>
<script language="JavaScript" type="text/javascript">
<!--
var crawlername = new Array("Google","Yahoo","Altavista (Raging)");
var crawleraction = new Array("http://www.google.com/search?q=","http://search.yahoo.com/bin/search?p=","http://www.altavista.com/sites/search/res_text?q=");
function populateCrawlers()
{
var d=0,startcount=0,option;
for (d=0;d<crawlername.length;d++)
{
option = new Option(crawlername[d],crawleraction[d]);
document.search.crawler.options[startcount] = option;
startcount++;
}
}
function initiateSearch(x)
{
var url;
url = x.crawler.options[x.crawler.selectedIndex].value+x.q.value;
self.location.href = url;
return (false);
}
//-->
</script>
</head>
<body onLoad="populateCrawlers()">
<h4 align="center">Quick Search On Various Search Engines</h4>
<form method="GET" name="search" onSubmit="return initiateSearch(this)">
<table summary="Search" width="50%" align="center">
<tr>
<th align="right">Search:</th>
<th align="left">
<input type="text" name="q" size="10" maxlength="100"> <input type="submit" value="GO">
</th>
</tr>
<tr>
<th align="right">Use:</th>
<th align="left">
<Select name="crawler">
</Select>
</th>
</tr>
</table>
</form>
But if you intend to add more search engines, you will probably find other "custom" configurations for the URL. So I'd suggest populating a third array for the tag ends that fall after the search term -- call it "crawlertag[]" or something like that. If the option involved ends with the search term, have that array element be a null value.
Then when you construct your "url" variable, just add the crawlertag[] element to the tail end. Does that seems sensible to you?
[alltheweb.com...]
Note the part that reads 'q=test'. Well, move that to the end
[alltheweb.com...]
Then just remove your keyword
[alltheweb.com...]
THat is the string you would add into the javascript:
var crawlername = new Array("Google","Yahoo","Altavista (Raging)","FAST");
var crawleraction = new Array(
"http://www.google.com/search?q=",
"http://search.yahoo.com/bin/search?p=",
"http://www.altavista.com/sites/search/res_text?q=",
"http://www.alltheweb.com/search?cat=web&cs=utf-8&_sb_lang=en&q=");