Showing posts with label Detect. Show all posts
Showing posts with label Detect. Show all posts

Monday, March 2, 2015

Detect IE in Javascript


Below function will return up to IE 10

function IE(v) {
  return RegExp('msie' + (!isNaN(v)?('\\s'+v):''), 'i').test(navigator.userAgent);
}


and for IE 11 follow the below method

if(navigator.userAgent.indexOf("rv:11")>0 && navigator.userAgent.indexOf("Trident")>0)
{
alert("IE 11")
}