Click to See Complete Forum and Search --> : Browser re-direction script needed


invision
11-28-2002, 03:51 AM
Hello,

I first went to http://a1javascripts.com but their 'Browser re-direction' Javascript was a little limited. Any chance someone could make me up a new one incorporating all browsers out right now,

Thanks a trillion,

Michael.

P.S. Here's the original code I have:

<Script><!-- A1 Javascripts-http://www.A1javascripts.com --><!--
if (document.all) //IE4,5
loc = 'Your-IE4,5-choice.html'
else if (document.layers) //NS4
loc = 'Your-NS4-choice.html'
else if (document.getElementById) //NS5
loc = 'Your NS5 Choice.html'
else if (document.images) //NS3,IE4
loc = 'Your-NS3,IE4-choice.html'
else //NS2,IE3
loc = 'Your-NS2,IE3-choice.html'
window.location = loc;
//--></Script>

Charles
11-28-2002, 05:02 AM
Browser Watch used to keep a list of available browsers. When they stopped the list was over 130 items long. And that list didn't include the different versions of all of those browsers. If you are using redirection then you are doing something wrong. If you use HTML 4.01 Strict or XHTML 1.0 Strict properly then your page will work on every browser. If it's the JavaScript on your page that you are worried about then keep in mind that about 12% of users don't use it. Just make sure that your page 'fails safe' when, and not if, the JavaScript doesn't work.

gil davis
11-28-2002, 08:55 AM
http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html