Check if user is using IE

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

    Using the answers above; simple & condensed returning Boolean:

    var isIE = /(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent);

提交回复
热议问题