hallo self-javascriptler
folgendes problem steht an: eine index-seite, die ich erstellt habe, wird leider mit alten browsern grauenhaft dargestellt. alle html-versuche sind gescheitert (die seite muss mit den farben ganz aufgefüllt werden!). deshalb versuche ich jetzt schon seit stunden, ein javascript einzubauen, welches, je nach plattform (pc oder mac) und je nach browsern (ie, ns, opera) an die gewünschte seite weiterleitet. das script besteht hauptsächlich aus der switch-anweisung mac-pc und den unter-switch-anweisungen, welche dann den jeweiligen browser/die jeweilige browserversion ansprechen...
leider macht das script jedoch überhaupt nix. es gibt zwar keine fehler aus (immerhin), aber es leitet auch an keine seite weiter.
hat jemand eine ahnung, was an dem script falsch ist?
die seite sollte schon längstens fertig sein - es eilt, oje!
die url lautet: www.quelle-31.ch/test.html (die echte einstiegsseite ist die index.html-seite) bzw. das script sieht folgendermassen aus:
-------------------
<script language="javascript">
platform = navigator.platform;
browser = navigator.appName;
version = navigator.appVersion.substring(0,1);
switch (platform) {
case "Mac":
switch("browser") {
case "Microsoft Internet Explorer" :
switch(version){
case "4" : window.location.href="mac_msie_4.html";
case "5" : window.location.href="mac_msie_5.html";
}
case "Netscape" :
switch(version){
case "4" : window.location.href="mac_ns_4.html";
case "5" : window.location.href="mac_ns_5.html";
}
case "Opera" :
switch(version){
case "4" : window.location.href="mac_op_4.html";
case "5" : window.location.href="mac_op_5.html";
case "6" : window.location.href="mac_op_6.html";
case "7" : window.location.href="mac_op_7.html";
}
// weitere Mac Browser
}
//weitere Betriebssysteme
case "Win32":
switch("browser") {
case "Microsoft Internet Explorer" :
switch(version){
case "4" : window.location.href="pc_msie_4.html";
case "5" : window.location.href="pc_msie_5.html";
case "6" : window.location.href="pc_msie_6.html";
}
case "Netscape" :
switch(version){
case "4" : window.location.href="pc_ns_4.html";
case "5" : window.location.href="pc_ns_5.html";
case "6" : window.location.href="pc_ns_6.html";
}
case "Opera" :
switch(version){
case "4" : window.location.href="pc_op_4.html";
case "5" : window.location.href="pc_op_5.html";
case "6" : window.location.href="pc_op_6.html";
case "7" : window.location.href="pc_op_7.html";
}
}
}
</script>
--------------------
wer kann helfen? langsam verzweifle ich :-(
danke jetzt schon für tipps!!!
femjava