Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Detect/Redirect

Status
Not open for further replies.

Tezdread

Technical User
Oct 23, 2000
468
GB
Hi all, I just can't get the design right so it looks the same in Netscape 4x Netscape 6 and IE 5x. I have used some CSS and IE 5x and Netscape 6 view it in the same way (great) but then when I came to view it in Netscape 4x it was no good :(

The only way around this as far as I know is to have a script that will detect the browser type/version and on the link click the next page to be loaded will be the right one for the browser.

So NN6 & IE5x will go to page 1 and NN 4x will go to page 2, but only link dependant? I am not sure how it works? :( (confused just thinking about it) Hope you can understand me :)

Thanks in advance...
 
document.write your links based on the navigator.appVersion. navigator.appVersion will return a string that look like this (depending on the browser they are using):

4.0 (compatible; MSIE 5.5; Windows NT 4.0)

than you can use indexOf to determine what browser they are using:

if(navigator.appVersion.indexOf(MSIE 5.5>=0)
{..its IE 5.5..}


jared@aauser.com
 
oops... indexOf requires a string argument:

if(navigator.appVersion.indexOf("MSIE 5.5">=0)
{..its IE 5.5..} jared@aauser.com
 
Thanks jaredn you always come to the rescue :) Shortly after I posted this I found a script to do the job also, thank you for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top