falk: neues fenster bei suchfunktion öffnen

hi,
habe grad erst mit js angefangen und habe grad ein KLEINES problem ... aber ich komm nicht drauf ...

folgender code erzeugt ein pulldown-menu mit links zu einigen suchmaschinen. beim klick auf den "suchen"-button wird der sucheintrag(keyword) an die ausgewählte suchmaschine geschickt und im gleichen browser-fenster angezeigt.
beim klick auf den "suchen"-button soll die suchanfrage jedoch in einem NEUEN fenster angezeigt werden ... kann mir dabei jemand mit etwas mehr erfahrung bitte helfen?

<script language="javascript">

function getit(form){

engine=

document.search.engine.options[document.search.engine.selectedIndex].value;

if (engine == "Google") engine =

"http://www.google.de/search?hl=de&ie=UTF-8&oe=UTF-8&q=";

if (engine == "Fireball") engine =

"http://suche.fireball.de/fcgi/query1.fcg?action=query&pg=express&q=";

if (engine == "Metacrawler") engine =

"http://217.160.131.108/?per_page=10&timeout=6&qry=";

if (engine == "Yahoo") engine =

"http://de.search.yahoo.com/search/de?p=";

if (engine == "Filesearch") engine =

"http://www.filesearching.com/cgi-bin/s?q=";

if (engine == "DeluxNetwork") engine =

"http://www.deluxserials.com/index.php?search=";

if (engine == "Hotbot") engine =

"http://www.hotbot.lycos.de/result.html?query=";

if (engine == "Lycos") engine =

"http://suche.lycos.de/cgi-bin/pursuit?matchmode=and&mtemp=main&etemp=error&query=";

if (engine == "Astalavista") engine =

"http://astalavista.box.sk/cgi-bin/robot?srch=";

keywords = convert(document.search.keywords.value);

location= engine +keywords

}

function convert(input) {

var output = "";

for (var i = 0; i < input.length; ++i) {

var temp = input.charAt(i); if (temp == " ") temp = "+";

output += temp;

}

return output;

}

</script>

<form method=post name=search>
Suchfunktion: <select name="engine">
<option selected value="Google" style="background: #FFDF00; color: #000000;">Google
<option value="Metacrawler" style="background: #FFDF00; color: #000000;">Metacrawler
<option value="Lycos" style="background: #FFBE00; color: #000000;">Lycos
<option value="Fireball" style="background: #FFBE00; color: #000000;">Fireball
<option value="Yahoo" style="background: #FFBE00; color: #000000;">Yahoo
<option value="Hotbot" style="background: #FFBE00; color: #000000;">HotBot
<option value="Filesearch" style="background: #FF9E00; color: #000000;">Filesearch
<option value="DeluxNetwork" style="background: #FF9E00; color: #000000;">DeluxNetwork
<option value="Astalavista" style="background: #FF9E00; color: #000000;">Astalavista
</select>
<input type=text size=24 name=keywords style="border: 1 solid #000000; background-color: #FFBE00;"></input>
<input type=button value=suchen style="border: 1 solid #000000; background-color: #FFBE00;"
onmouseover="this.style.background='#0000FF'; this.style.color='#FFFFFF';"
onmouseout="this.style.background='#FFBE00'; this.style.color='#000000';"
onclick=getit(this.form)></input>
</form>

v-5-5

  1. Hallo,

    statt "location=..." musst Du "window.open" benutzen. Mehr dazu findest Du hier: http://selfhtml.teamone.de/javascript/objekte/window.htm#open.

    Gruß,    Jürgen