Language:

phaziz.com Siteselector

Language: Deutsch
Programming Language: JavaScript
Published by: phaziz
Last Update: 5/1/2006
Views: 873

Description

Eine Navigation per Javascript und einem HTML-Select-Formularelement.

Code

1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <html> 3 <head> 4 <title>phaziz.com // Site- // Content-Selector</title> 5 <meta name="author" content="Christian Becher // phaziz.com" > 6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" > 7 <meta http-equiv="Content-Script-Type" content="text/javascript" > 8 <meta http-equiv="Content-Style-Type" content="text/css" > 9 <script language="javascript" type="text/javascript"> 10 <!-- 11 /* phaziz.com // Christian Becher */ 12 /* Site- // Content-Selector */ 13 14 15 function surfto(form) 16 { 17 var myindex = form.destination.selectedIndex 18 if (form.destination.options[myindex].value != "") 19 { 20 window.location.href=form.destination.options[myindex].value; 21 } 22 } 23 --> 24 </script> 25 </head> 26 <body> 27 28 <form> 29 <select name="destination" onchange="surfto(this.form)"> 30 <option selected="selected" value="">Bitte wählen</option> 31 32 <option value="http://www.phaziz.com/">http://www.phaziz.com</option> 33 <option value="index.html">Startseite</option> 34 <option value="seite2.html">Seite 2</option> 35 <option value="seite3.html">Seite 3</option> 36 </select> 37 </form> 38 39 <h1>Startseite</h1> 40 41 </body> 42 </html> 43

No comments avaiable

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS