Check if user is using IE

后端 未结 30 2074
心在旅途
心在旅途 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:02

    function detectIE() {
        var ua = window.navigator.userAgent;
        var ie = ua.search(/(MSIE|Trident|Edge)/);
    
        return ie > -1;
    }
    

提交回复
热议问题