Answer the question
In order to leave comments, you need to log in
How to detect IE including 11?
It is necessary to determine in js that the user has logged in with IE. In this case, it is necessary that the method takes into account the 11th version. I don't need to define the version, just the fact itself. Anyone suggest a solution?
Answer the question
In order to leave comments, you need to log in
var ua = window.navigator.userAgent.toLowerCase(),
is_ie = (/trident/gi).test(ua) || (/msie/gi).test(ua);
Conditional compilation
Branching variant:
/*@cc_on @if (@_jscript)
console.log('Я — осёл и мой номер ' + @_jscript_version);
@else @*/
document.write('Я — обычный современный утюг');
/*@end @*/
/*@cc_on
console.log('Я — осёл и мой номер ' + @_jscript_version);
@*/
Perhaps you do not need to determine the version of IE, but to determine what features the browser can do? Look at modernizr.com/.
And for IE older versions there are conditional comments: www.quirksmode.org/css/condcom.html
Well, specifically the answer to the question: stackoverflow.com/questions/13478303/correct-way-t...
if (document.all) {
// Код для всех версий IE. В других браузерах выполняться не будет.
}
htmlbook.ru/samlayout/internet-explorer/uslovnye-k...
example:
jsfiddle.net/umcyyyc4/3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question