Check if user is using IE

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

    I landed on this page in 2020, and I see that till IE5 all userAgent string have Trident, I'm not sure if they have changed anything. So checking only for Trident in the userAgent worked for me.

    var isIE = navigator.userAgent.indexOf('Trident') > -1;
    

提交回复
热议问题