Slight mod for Opera 6 test

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Slight mod for Opera 6 test

Post by kevin3442 »

Hi Andy,

I like to use the menu's built-in browser checking because it's convenient (already in there, might as well use it) and very thorough. But while testing something, I was puzzled as to why the menu's built-in browser detection was not catching Opera 6.05 (on Win2k in this case). I see that you evaluate navigator.userAgent.toLowerCase() for the presence of "opera 6". That seems to work fine, if the user has Opera set to identify itself as some other browser. But when it's set to identify itself as Opera (imagine that), then the userAgent contains "opera/6" rather than "opera 6". I see in your code that you account for this completely annoying quirk with opera 7, but not with 6. A small change, like what you already do with opera 7, should do the trick.

Code: Select all

op6=(_nu.indexOf("opera 6")!=-1||_nu.indexOf("opera/6")!=-1)?_t:_f;
I'm still learning it, but I really like version 5 a lot... superb job all around! Congratulations on a job well done.

Kevin
Post Reply