Sees 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 it, so what you need to do is to offer two pages -- one for Netscape and one for Explorer. 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!)

<script language="JavaScript">
function NAME_IT()
{ var BrowserType=navigator.userAgent;
if (BrowserType.indexOf("MSIE") == 25)
{alert('IE 3.X MESSAGE');}
else { alert('NETSCAPE 2.X MESSAGE');}
} </script>
<BODY="#FFFFFF" onClick="NAME_IT()">

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.

Back to the Miscellaneous Scripts