Pulldownmenu
Uwe
- javascript
Bei folgendem Skript können über ein Pulldown-Menü verschiedene Seiten ausgewählt und in einem bestimmten Frame angezeigt werden.
Ich möchte allerdings nicht die anzeige in einem anderen Frame sondern in einer neuen Seite (_blank).
Wie hat der Code dann auszusehen.
Allerbesten Dank für eure Hilfe.
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "x")
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
else if(x == "end") location.href = parent.frames[1].location;
else
{
parent.frames[4].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>
Hallo Uwe!
Dazu musst Du die Zeile
parent.frames[4].location.href = x;
durch die window.open-funktion ersetzen. Da Dein Script offenbar noch mehr macht (unterschiedliche Frames), hier der Einfachheit halber meine Dropdown-Box. Einfach anpassen - weitere Möglichkeiten zum Öffnen via JavaScript unter
http://selfhtml.teamone.de/javascript/objekte/window.htm#open
<select name="topic" onChange="(this.options[this.options.selectedIndex].value != '') ? window.open(this.options[this.options.selectedIndex].value,'Fenstername','') : this.options.selectedIndex = 0;">
<option>Titel</option>
<option>----------------------------------------</option>
<option value="/product/internet/access.html">adsl</option>
<option value="/product/software/standard.html">betriebssystem</option>
</select>
mfg
norbert =:-)