FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Browser Version detection and redirection

 


eday2010
After googling endlessly and searching these forums, I have not found what I am loking for.

Basically, I need a browser detection script that will detect what version of what browser the user is reading. My site works with IE 5.5SP2 and up, Netscape 7.2 and up, Opera 7.1 and up, and Firefox 1.0 and up (have not tested on any Mac browsers.

What I want the script to do is once it's detected a version ofone of these browsers or higher, to continue loading the page. If it detects a lower version, or any other browser, I want it to direct users to a page telling them they are using an old or untested browser, where I have links to update the tested browsers and a link to continue to the site anyways

One script I found isn't working, and I don't know Javascript. Can anyone help?
blueray
Checkout www.mozilla.com, it has a simple tutorial on how to create that script.

Hope this help
eday2010
Where is it on their site? I was unable to find a tutorial on their site to do this.
Digital Thoth
Try www.mozilla.com without the period. The above link takes you to a search engine because of the punctuation at the end.
mariohs
For Internet Explorer, the most common browser around, you can use conditional comments. But I don't know if this will serve for you but anyway, the tip is here. Wink
eday2010
I did try www.mozilla.com with no comma at the end. I found nothing helpful on Mozilla's site.

And the stuff in that conitional statement link isn't what I need. I need the site to go to one of two pages depending on what browser and version the site is being viewed with.

This one redirects the way it should, but I need to add other broswers like Safari and Camino and everything else to go to index2.html, while making sure that browsers above those defined here go to the index.html page.

Code:
<script type="text/javascript">
<!--
browser = navigator.appName
ver = navigator.appVersion
version = ver.substring(0,1)
if (browser=="Internet Explorer") {
if (version<="5.5")
document.location.href="index2.html"
}
if (browser=="Netscape") {
if (version<="7.2")
document.location.href="index2.html"
}
if (browser=="Firefox") {
if (version<="1.0")
document.location.href="index2.html"
}
if (browser=="Opera") {
if (version<="7.1")
document.location.href="index2.html"
}
//-->
</script>


And how do I specify that IE has to be 5.5 SP2?
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.