Detect IE10 using JavaScript

Here are possible ways to detect IE10 browser using Javascript:

Though the following aren’t perfect solution it could be a better start.

Method 1:


var ie10 = (navigator.userAgent.match(/Trident\/[6]/i));

Method 2:


var ie10 = (navigator.userAgent.match(/MSIE 10/i));

Method 3:



<!doctype>
<html>
<head>
<!--[if (gt IE 9)]><script type="text/javascript">window.ie10 = true;</script> <![endif]-->
</head>
<body>

<script type=”text/javascript”>
if(window.ie10)
document.write(‘IE 10 detected.’);
else
document.write(‘Browser is NOT IE10.’);
</script>
</body>
</html>

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s