Showing posts with label internet explorer. Show all posts
Showing posts with label internet explorer. Show all posts

Tuesday, September 18, 2012

IE - Compatiblity Issue

If you want your site not to open in Compatibility Mode in IE just add the following line in HEAD og your page.

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />

Now it'll try IE9 mode first, IE8, then IE7. You can even set IE=EDGE so it'll use the highest mode possible.

Friday, March 30, 2012

Javascript - Detect Browser

function getInternetExplorerVersion()
{
    var rv = -1; // Return value assumes failure.
    
    //You can user "navigator.appName" to detect other browsers as well.
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
        {
             rv = parseFloat(RegExp.$1);
             if (rv > -1)
             {   
                 if (rv < 9.0)
                 {
                       alert("This is Not Microsoft Internet Explorer 9.0");
                       return;
                  }
             }
         }
      }
}