Detect IE 5 or higher

I used this code to alert user to use IE 5 or higher to browse the website.

In the HTML head:
<script type=”text/javascript” language=”JavaScript”>
<!–
function detectBrowser()
{
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if ((browser!=”Microsoft Internet Explorer” ) || (version<4))
{
alert(“Please use Internet Explorer to continue”);
}
}
//–>
</script>

In the HTML body:
<body onload=”detectBrowser()”>

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: