Could not detect my browser IE 11

I am trying to write IE specific code that

    if (agent.indexOf("MSIE") != -1)
    {
        alert('IE');
        //IE specific
    }

But when I tried Alert (agent.indexOf ("MSIE")); He typed -1. But I can correctly use my current browser using agent.indexOf () in Firefox and Chrome.

Can someone help me write code for a specific browser? I checked the previous questions based on the browser code, but none helped. The problem occurs in IE 11 version 11.0.24 as well as 11.0.25. Thanks.

+4
source share
1 answer

, IE ActiveXObject, , - , , , . , , , . , , , IE. if ('ActiveXObject' in window) { alert('IE'); }

+1

Source: https://habr.com/ru/post/1619176/


All Articles