M
Max of Mad
Hi all,
I wrote this a while back, but I was unable to get it to work for
mozilla. Looked all over the place, but could not find anything on why.
Basically, this has a dropdown of some search engines, and a text input
for the search term. Click GO and it takes you to the selected search
engine with the query.
This works great on IE and Opera, but it will not work in Mozilla. My
guess is that Moz doesn't like the window.location.href... I've tried
just location.href, and a bunch of others, to no avail.
using win2000, IE6, Opera 6.01, and Mozilla 1.6.
Does anyone have any ideas?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="notepad.exe">
<TITLE>Search</TITLE>
</HEAD>
<body bgcolor="#aaaaaa">
<STYLE TYPE="text/css">
A {COLOR: #ffffff; TEXT-DECORATION: none}
</STYLE>
<script language="JavaScript">
function GoSearch() {
var eQuery;
var goQuery;
var Engine;
Engine = sform.searchengine.value;
eQuery = sform.squery.value;
goQuery='';
if (Engine == 'goog') { goQuery = 'http://www.google.com/search?q=' +
eQuery; }
if (Engine == 'aol') { goQuery =
'http://search.aol.com/aolcom/search?query=' + eQuery; }
if (Engine == 'hotb') { goQuery =
'http://www.hotbot.com/default.asp?query=' + eQuery; }
if (Engine == 'lyco') { goQuery =
'http://search.lycos.com/default.asp?query=' + eQuery; }
if (Engine == 'over') { goQuery =
'http://www.overture.com/d/search/?Keywords=' + eQuery; }
if (Engine == 'alta') { goQuery =
'http://www.altavista.com/web/results?q=' + eQuery; }
if (Engine == 'all') { goQuery =
'http://www.alltheweb.com/search?cat=web&q=' + eQuery; }
if (Engine == 'teo') { goQuery = 'http://s.teoma.com/search?q=' + eQuery; }
if (Engine == 'yah') { goQuery =
'http://search.yahoo.com/search?ei=UTF-8&fr=sfp&p=' + eQuery; }
if (goQuery != '') { window.location.href = (goQuery); }
}
</script>
<form method="post" id="sform" name="sform" action="javascript:GoSearch();">
<br>Search
<select name="searchengine">
<option value="goog">Google
<option value="all">AllTheWeb
<option value="alta">Altavista
<option value="aol">AOL
<option value="hotb">HotBot
<option value="lyco">Lycos
<option value="over">Overture
<option value="teo">Teoma
<option value="yah">Yahoo
</select>
for
<input type="text" name="squery" value="">
<button onClick="javascript:GoSearch();" value="Go" id=button1
name=button1>Go</button>
</form>
</BODY>
</HTML>
Max of Mad
I wrote this a while back, but I was unable to get it to work for
mozilla. Looked all over the place, but could not find anything on why.
Basically, this has a dropdown of some search engines, and a text input
for the search term. Click GO and it takes you to the selected search
engine with the query.
This works great on IE and Opera, but it will not work in Mozilla. My
guess is that Moz doesn't like the window.location.href... I've tried
just location.href, and a bunch of others, to no avail.
using win2000, IE6, Opera 6.01, and Mozilla 1.6.
Does anyone have any ideas?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="notepad.exe">
<TITLE>Search</TITLE>
</HEAD>
<body bgcolor="#aaaaaa">
<STYLE TYPE="text/css">
A {COLOR: #ffffff; TEXT-DECORATION: none}
</STYLE>
<script language="JavaScript">
function GoSearch() {
var eQuery;
var goQuery;
var Engine;
Engine = sform.searchengine.value;
eQuery = sform.squery.value;
goQuery='';
if (Engine == 'goog') { goQuery = 'http://www.google.com/search?q=' +
eQuery; }
if (Engine == 'aol') { goQuery =
'http://search.aol.com/aolcom/search?query=' + eQuery; }
if (Engine == 'hotb') { goQuery =
'http://www.hotbot.com/default.asp?query=' + eQuery; }
if (Engine == 'lyco') { goQuery =
'http://search.lycos.com/default.asp?query=' + eQuery; }
if (Engine == 'over') { goQuery =
'http://www.overture.com/d/search/?Keywords=' + eQuery; }
if (Engine == 'alta') { goQuery =
'http://www.altavista.com/web/results?q=' + eQuery; }
if (Engine == 'all') { goQuery =
'http://www.alltheweb.com/search?cat=web&q=' + eQuery; }
if (Engine == 'teo') { goQuery = 'http://s.teoma.com/search?q=' + eQuery; }
if (Engine == 'yah') { goQuery =
'http://search.yahoo.com/search?ei=UTF-8&fr=sfp&p=' + eQuery; }
if (goQuery != '') { window.location.href = (goQuery); }
}
</script>
<form method="post" id="sform" name="sform" action="javascript:GoSearch();">
<br>Search
<select name="searchengine">
<option value="goog">Google
<option value="all">AllTheWeb
<option value="alta">Altavista
<option value="aol">AOL
<option value="hotb">HotBot
<option value="lyco">Lycos
<option value="over">Overture
<option value="teo">Teoma
<option value="yah">Yahoo
</select>
for
<input type="text" name="squery" value="">
<button onClick="javascript:GoSearch();" value="Go" id=button1
name=button1>Go</button>
</form>
</BODY>
</HTML>
Max of Mad