Menu otwierające okno

Skrypt tworzy menu rozwijane z adresami - czytelnik może zaznaczyć opcję otwierania adresu w nowym oknie.

 
Otwórz w oddzielnym oknie

Skopiuj przykładowy kod


<form name="mycombowopt">
<select  name="example" size=1>
	<option value="http://www.pckurier.pl">PCkurier</option>
	<option value="http://www.enter.pl">Enter</option>
	<option value="http://www.gambler.com.pl">Gambler</option>
	<option value="http://www.chip.pl">Chip</option>
	<option value="http://www.pcworld.com.pl">PC World Komputer</option>
  </select> <input type="button" value="Go!" onClick="gothere()"> <br>
  <input type="checkbox" name="windowoption" value="ON">Otwórz w oddzielnym oknie</p>
</form>

<script language="javascript">
<!--

/*Combo box with "open in new window" credit
-By Website Abstraction (www.wsabstract.com)
Over 200+ free scripts here!
*/

function gothere(){
var thebox=document.mycombowopt
if (thebox.windowoption.checked){
if (!window.newwindow)
newwindow=window.open("")
newwindow.location=
thebox.example.options[thebox.example.selectedIndex].value
}
else
location=
thebox.example.options[thebox.example.selectedIndex].value
}
//-->
</script>