Sven Rautenberg: Meldung bei falschem Browser

Beitrag lesen

Moin!

if (document.layers)
     window.location = "sorryns4.html";

fischt Dir NS4er aus den Teich.

Ja (aber [1])

if (document.all)
     window.location = "sorryie.html";

holt die IE raus und

_Alle_ IEs (leider nicht [1])

if (document.getElementById && !document.all)
     window.location = "sorrymoz.html";

bringt Dir die NS6, 7 und mozillas.

Und Operas, Konquerors - eigentlich alle, die neues DOM kennen und kein IE sind. Aber leider [1].

Opera wiederum bekommt man gut mit

if(window.opera)
    window.location = "sorryopera.html";

Das stimmt (aber auch hier [1]).

Und jetzt kommt:

[1]: window.location ist böse, benutze window.location.href.

- Sven Rautenberg

--
Signatur oder nicht Signatur - das ist hier die Frage!