Forcing Visitors to Use Internet Explorer 5 or higher?
Hi,
I've designed a web site that for one reason or another only looks good in Internet Explorer 5 or higher
Since most of my visitors are currently using IE5+, I am not too concerned about this except for the fact that I'd like to "force" all my visitors to use or upgrade their browsers to IE5+ before they can view the site.
I've seen this feature used on other web sites whereby they block the viewing of certain web pages based on the browser (ie. Netscape 4.7, IE4, etc.) and was wondering how I would go about doing this for my own web site?
Preferably, so that I don't have to update each page individually, I would like to use some kind of script that I can add to my directory that will run whenever a user visits any one of my web pages, detects the browser, and if it is not IE 5 or greater, shows a web page stating that IE5+ is required to view the information. Other suggestions are also appreciated.
Any help would be greatly appreciated.
P.S. -> I personally support browser alternatives like Netscape, Mozilla, Opera however the site was built in a rush and I didn't have a chance to follow the open standards and don't have the time to go back and fix it
Thank you for understanding.
Try the script below. Place it as shown into a text file, and save the file with a .js extension (not .html).
if (navigator.appName != "Microsoft Internet Explorer" && navigator.appVersion.substring(22,23) <= 4)
{
location.href = "whateverpage.html"
}
Now in the pages where you want to detect the users browser enter this line
<script src="sitetest.js">
Obviously you would change the file name sitetest.js to whatever name you saved the .js file as. Also you would need to change the whateverpage.html with the page you want all those other users who aren't using IE5+ to be redirected to.
Note that this won't exclude some of the newer Opera browsers as they return "Microsoft Internet Explorer" for the appName property, and they return the same appVersion string as Internet Explorer. These two strings haven't changed since the early browsers so you shouldn't have to worry about new releases. If a change is made to these strings in future versions (doubtful though) then you only need alter the .js file to resolve any problems.
Re: Forcing Visitors to Use Internet Explorer 5 or higher?
Originally posted by powershot
P.S. -> I personally support browser alternatives like Netscape, Mozilla, Opera however the site was built in a rush and I didn't have a chance to follow the open standards and don't have the time to go back and fix it
Thank you for understanding.
2 wrongs doesn't make a right.
I would just put up a notice on the page that it sadly only works as it should in IE 5.5+.
Prohibiting people from even accessing the site unless they use IE 5.5+ (which BTW shuts out ALL Mac and Linux users also) is the worst possible solution you could choose.
You should bear in mind though that AOL and Compuserve (along with countless general users) are almost definately upgrading to Netscape 7, so that's a potential of over 37 million (if I remember correctly) users that you are locking out.
I know the script was wrong i just want to use that like a example but anyway do you know how to use mouseover , onclick for images with links in HTML or java because i am trying to find how to script that in html or javascript using the easyest way possable
Many people already feared the staff because they banned there *** !
Well i want make a menu with my own images where if you hold your mouse over them they will change to one of my other image then when you click on the them they change to a different image then the one you hold your mouse over and if you know how to add sound it also that will help even more !
Many people already feared the staff because they banned there *** !
Originally posted by Kaisa Well i want make a menu with my own images where if you hold your mouse over them they will change to one of my other image then when you click on the them they change to a different image then the one you hold your mouse over
Do you want to return to the original image when you finally "mouse out"?
No, the onMouseOver attribute only activates a script when you move your mouse over it. After you have moved off, whatever happened when you did onMouseOver will still be there. To undo the changes, you use onMouseOut.
Bookmarks