How to detect Internet Explorer 11 and below versions?

后端 未结 4 1472
感动是毒
感动是毒 2020-12-29 08:02

I\'m wondering how I could detect if the user viewing my website is using Internet Explorer 11 or below versions with Javascript.

It should be compatible and

4条回答
  •  感动是毒
    2020-12-29 08:26

    I'd like to streamline the correct answer. This returns true or false:

    function is_IE() {
      return (window.navigator.userAgent.match(/MSIE|Trident/) !== null);
    }
    

提交回复
热议问题