Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to detect IE11 using jquery [duplicate]

I have codes $.browser to detect the browser and upon the result some layout style is based. but now with ie 11, $.browser would give mozilla v.11. any suggestion to repair ?

like image 688
therion Avatar asked Nov 20 '13 06:11

therion


1 Answers

Try this:

var isIE11 = !!navigator.userAgent.match(/Trident.*rv\:11\./);
alert(isIE11);

EDIT:

Editted in a regex fix, taken from the comments. This fix works in the current version of IE11 as of 2/17/2014.

like image 195
swt Avatar answered Sep 30 '22 18:09

swt