Check if user is using IE

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

    I've placed this code in the document ready function and it only triggers in internet explorer. Tested in Internet Explorer 11.

    var ua = window.navigator.userAgent;
    ms_ie = /MSIE|Trident/.test(ua);
    if ( ms_ie ) {
        //Do internet explorer exclusive behaviour here
    }
    

提交回复
热议问题