Check if user is using IE

后端 未结 30 2051
心在旅途
心在旅途 2020-11-22 04:34

I am calling a function like the one below by click on divs with a certain class.

Is there a way I can check when starting the function if a user is using Internet

30条回答
  •  迷失自我
    2020-11-22 05:05

    Or this really short version, returns true if the browsers is Internet Explorer:

    function isIe() {
        return window.navigator.userAgent.indexOf("MSIE ") > 0
            || !!navigator.userAgent.match(/Trident.*rv\:11\./);
    }
    

提交回复
热议问题