Closed Thread Icon

Preserved Topic: Browser detection for NN 6.1 Pages that link to <a href="https://ozoneasylum.com/backlink?for=18151" title="Pages that link to Preserved Topic: Browser detection for NN 6.1" rel="nofollow" >Preserved Topic: Browser detection for NN 6.1\

 
Author Thread
butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-19-2001 22:51

I have some pages that NN 6.0 kills, but that 6.1 renders fairly well. I currently have a script that redirects any browser except IE to a different version of the page. I would like to know how to modify it to make NN 6.1 only and IE to not be redirected.

Here's what I'm currently using:

<SCRIPT LANGUAGE = "JavaScript">
<!--

var isIE = (document.all) ? 1 : 0;
var isMozilla = ((document.getElementById) && (!document.all)) ? 1 : 0;

if (!isIE) window.location.replace("http://www.greatdaneclubofraritanvalley.com/html/index.html");
//-->
</script>

I just don't know how to single out NN 6.1

Thanks everybody

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-20-2001 00:58

I don't have 6.0 (which was weak in it's JS implementation)
but it this might work

if (document.getElementById && !(navigator.appVersion.indexOf(6.0) > -1))



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-20-2001 01:02

Thanks Bitdamaged

I couldn't even get NN 6.0 to install on my machine. What I have now that really seems to be pretty good so far is NN 6.1.

Thanks again

- Resolutions, Of All My Fruitless Searches -

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-20-2001 01:40

Shoot I actually have 6.0 and that code won't work

I'm downloading 6.1 right now. I'll see if I can fix the code.



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-20-2001 01:44

Dammit. I'm not sure it can be done. both are showing up as Mozilla 5.0 in JS you may need to do it on the server side, the header code may be different



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-20-2001 02:05

Yea

I've been wrestling with it, but can't seem to make anything work. Here's the string NN 6.1 gives me when I check navigator.userAgent:


Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1


Is there any way to use a regexp to single out the 6/6.1 at the end of that string? I still have no clue for writting regular expressions, so if I'm way off the mark with that suggestion, just let me know.

Thanks

[This message has been edited by butcher (edited 08-20-2001).]

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-20-2001 02:53

What's wrong with this:


var isIE = ((document.all) &#0124; &#0124; ((navigator.vendorSub.indexOf(6.1)) > -1)) ? 1 : 0;
var isMozilla = ((document.getElementById) && (!document.all)) ? 1 : 0;

if(!isIE)
window.location.replace("http://www.greatdaneclubofraritanvalley.com/html/index.html");


It does let NN 6.1 thru as part of isIE, but for some reason, it doesn't redirect NN 4.7 like it did before. I'm not quite sure why because navigator.vendorSub is undefined in NN 4.7.

Any thoughts on why this won't work?

Thanks again



mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-20-2001 10:20

Check navigator.userAgent insetad of navigator.vendorSub and see will it work correctly. If it still makes problems I'll write you a regex...

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 08-20-2001 21:36

That seems to have done the trick.

Thanks mr.maX!

« BackwardsOnwards »

Show Forum Drop Down Menu