Detect whether browser is IE 7 or lower?

后端 未结 6 2036
萌比男神i
萌比男神i 2020-12-15 07:46

So i am going to add a redirect to my site to toss every one that is using ie 7 or lower off to a different page and came up with this JavaScript, but it seems to have stopp

6条回答
  •  臣服心动
    2020-12-15 08:47

    You can test it with this regular expression: (MSIE\ [0-7]\.\d+)

    Here is a JavaScript example on how to use it:

    if (/(MSIE\ [0-7]\.\d+)/.test(navigator.userAgent)) {
        // do something
    }
    

提交回复
热议问题