Woo! I scored 100 on the Nettuts quiz about the basics of PHP. Give it a shot! via
Jan, 2010
29

How to detect and avoid browsers with Javascript

I am going to go ahead a regurgitate what everyone has been saying for years now, that IE6 is just well past its prime and its time to retire it. This has been beaten death time and time again, so I am not going to list all the reasons why we should drop it, I am just going to tell you how to make sure that users with IE6 are properly handled on your site.

Its actually very simple. First you drop in this bit of Javascript.

//Nothing special here... just telling javascript to kick IE users out
var browser=navigator.appName;
if(browser == "Microsoft Internet Explorer"){
window.location = "no_ie.html";
}else{
//you can remove this, I just like to see what browser we ARE seeing
//alert(browser);
}

This should stop IE users, if you are trying to detect some other browser or you are curious what the navigator.appName is returning just un comment the alert above. You can also change the window.location to be any URL you like. In my case I redirect them to a page that thoroughly insults IE6.

Add this to your sites and support IEDeathMarch.org

This entry was posted on 01.29.2010 at 6:11 pm and is filed under Code Bin. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Green Web Hosting! This site hosted by DreamHost.
3D model design services. Nice 3d modeling service site. Product Design Services. | Пиццерия, пицца на дом Басманный. | I find love ukraine girls. Mam help me.