Page Redirection depending on the browser. Desperately begging for help =)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alza_Javashier
Posted On:   Monday, June 28, 2004 12:53 PM

Hi! I have a problem. My homepage, what is under construction at the moment, is only viewable without errors with Explorer. I want to insert a javascript to the index.htm file, that redirects the visitors, depending on their browser. I am currently trying this: if ((navigator.appName=="Microsoft Internet Explorer")&(navigator.userAgent.indexOf("Opera")==-1)&(navigator.userAgent.indexOf("Netscape")==-1)&(navigator.userAgent.indexOf("Mozilla")==-1)){document.location.href="good.htm";}else{document.location.href="wrong.htm";} ]]>]]> The indexOf stuff is needed, because Mozilla, Netscape and Opera would trick the script, because they make themselves look like Explorer. ...But this still doesn't wo   More>>

Hi!

I have a problem. My homepage, what is under construction at the moment, is only viewable without errors with Explorer. I want to insert a javascript to the index.htm file, that redirects the visitors, depending on their browser.

I am currently trying this:



The indexOf stuff is needed, because Mozilla, Netscape and Opera would trick the script, because they make themselves look like Explorer.

...But this still doesn't work right, because now this script redirect every browser to "wrong.htm" (even explorer).

I would be very thankful, if somebody would help me out with a working script.

   <<Less
About | Sitemap | Contact