[thelist] Asking newbie questions

Ben Dyer ben_dyer at imaginuity.com
Wed Nov 7 15:31:02 CST 2001


At 03:19 PM 11/7/2001, you wrote:
>I'm trying to set up a browser detect and page switcheroo thingy (tres
>descriptive n'est ce pa?).

Mais oui. :)

>I want users coming in on NS4.* to go to a
>different page. All of the things I've found will detect what browser
>someone is on, but I don't know how to take that and get the page to
>change.I was using the browser detection based on Ultimate Client
>Sniffer, from
><http://developer.netscape.com/docs/examples/javascript/browser_type.html>.

Ironic.  The page doesn't seem to cooperate in IE5.

http://my.netscape.com/badbrowser.tmpl

It says it's not there, but look at the file name.  They look to be 
"pulling a Microsoft."

>I'm guessing it would be something like:  if btype==nav4  then go
>"hereURL", (or some such incomprehensible JS stuff).  I haven't seen
>anything that has all of these functions in one script. I guess what I
>need is a function that will redirect the page that adds on to the
>browser detect, but I haven't found any simple ones (read: ones that I
>could decipher). Does anyone have one, or know of one that I could use.

It looks like you can take that big, long script and modify it by adding 
this as the last line.

   if (is_nav4) {
     location.replace('hey_sucker_upgrade.html');
   }

The location.replace function prevents that nasty problem when you hit back 
and it immediately bounces you forward again which is really, really 
irritating.

--Ben


-------------------------------------------------------------
Ben Dyer, Senior Internet Developer, Imaginuity Interactive
http://www.imaginuity.com/
-------------------------------------------------------------
          Quidquid latine dictum sit, altum videtur.
-------------------------------------------------------------





More information about the thelist mailing list