TIP: Click on subject to list as thread! ANSI
echo: internet_uk
to: WILL LUKE
from: DAVID AIKEMA
date: 1998-02-19 22:19:00
subject: What Browser?

 * Reply to msg originally in FidoNet // Internet Chatter
 -=> Quoting WILL LUKE to ALL <=-
 WL> Should I do a different page for versions 3 and 4 - or stick with 4,
 WL> and wait for everyone to make the jump?
Here's something I picked up off a javascript tips site and it seems to
be just what you need.
Seeing Viewer Browser
This one is hard to show you because I don't offer the results it requires,
so I'll give you the code, tell you what to do and you can take it from
there. It does work. I've done it.
Let's say you have a page that has a lot of ActiveX or Explorer stuff on
it. As you know, Netscape won't support the stuff, so what you need to do
is to offer two pages - one for Netscape, and one for Explorer. You could
offer a firewall page that has the viewer choose by clicking or offer this
JavaScript. The following script produces a button, like above, only when
people click on the button, the script looks at their browsers and sends
them to the page that fits them be it Netscape or Explorer. Cool, huh?
Here's the script: Copy and paste right from here!

function NAME_IT()
{ var BrowserType=navigator.userAgent;
if (BrowserType.indexOf("MSIE") == 25)
{alert('IE 3.X MESSAGE');}
else { alert('NETSCAPE 2.X MESSAGE');}
} 

How To Alter It:
I should probably tell you that as the script now stands, it will
work. All it will do though is give a dialogue box that tells the
viewer what type of browser they have. Pretty useless. But, make
these few changes and it'll act as a page grabber:
Change the line that reads: {alert('IE 3.X MESSAGE');}
to: {location.href="indexIE.html"}
Change the line that reads: alert('NETSCAPE 2.X MESSAGE');}
to: location.href="indexNE.html"} 
Now, I named the two different pages (one for Netscape and one for
Explorer) indexNS.html and indexIE.html. If you name them something
different, make sure the script reflects what you name the pages.
... "Don't mince words, WILL ... what do you *REALLY* think?"
--- FMail/Win32 1.42/g
---------------
* Origin: Third Stone BBS / canbbs.net / UUCP Gateway! (1:153/8016)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.