Check if user is using IE

后端 未结 30 2285
心在旅途
心在旅途 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 04:50

    If you don't want to use the useragent, you could also just do this for checking if the browser is IE. The commented code actually runs in IE browsers and turns the "false" to "true".

    var isIE = /*@cc_on!@*/false;
    if(isIE){
        //The browser is IE.
    }else{
        //The browser is NOT IE.
    }   
    

提交回复
热议问题