Skip to content

Commit

Permalink
Support: Modified$.mobile.browser.ie to support IE10+ detection. Fixes
Browse files Browse the repository at this point in the history
…jquery-archive#4868 - IE Browser Check Unit Test Failing
  • Loading branch information
Brian Edgerton committed Aug 20, 2012
1 parent 78f114a commit 5922506
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/jquery.mobile.support.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ $.mobile.browser.ie = (function() {
div.innerHTML = "<!--[if gt IE " + ( ++v ) + "]><br><![endif]-->";
} while( a[0] );

return v > 4 ? v : !v;
v = v > 4 ? v : !v;

// Fallback to UA detection because IE10+ does not support conditional comments
if ( !v && navigator.appName === 'Microsoft Internet Explorer' ) {
var regex = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (regex.exec( navigator.userAgent ) !== null)
v = parseFloat( RegExp.$1 );
}

return v;
})();


Expand Down

0 comments on commit 5922506

Please sign in to comment.