Home
About
Specials
Web Design
Used Items
Tech
Links
Contact
Guestbook
Fort Myers
Hobbies

 

This site enhanced for

This WCCS Web Site is Optimized for the Internet Explorer Current Version
Tips ReDirect

As with any new technology, DHTML is not 100% available to all the people who come to view your web pages. This can result in problems when someone with a non 4.0 - version browser looks at a page which was created with the "CSS and Layers" HTML Output setting...

To that end, here's a JavaScript (readable by 3.0 browsers) procedure to (a) detect the version of the browser reading the page and (b) automatically direct the customer to the appropriate (CSS or non-CSS) page.

To see this Javascript in action, click here.

This script uses the navigator.appVersion property, specifically the first character of that property, which is always a version number. Since we know that all browsers before 4.0 can have problems dealing with CSS pages, we know to route these viewers to a more 3.0-friendly page...

Insert the following code Between Head Tags

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non-JS Aware Browsers
function checkver()
{
if(navigator.appVersion.substring(0,1) < 4)
{ window.location="URL"}
else
{ window.location="URL2"}
}
// end hiding -->
</SCRIPT>

Where URL and URL2 are the URLs you want the browser to be redirected to.

If you are using this just to direct pre-4.0 browsers away from the page, you can remove everything in italics since the code in italics routes the browser to a page only if the browser is of a version higher than 3.

And insert this code into the "Inside Body Tag" field:

onload = checkver()

And that should do it.

You are here: Home > Web Design > Web Tips > Tips ReDirect

All Prices mention on this web site are Subject to Change at any time.
All Pages are design and copyright Ó 1999,2000,2001 David Ward