Detect IE version (prior to v9) in JavaScript

前端 未结 30 1789
半阙折子戏
半阙折子戏 2020-11-22 08:44

I want to bounce users of our web site to an error page if they\'re using a version of Internet Explorer prior to v9. It\'s just not worth our time and money to

30条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 09:06

    Here is the way AngularJS checks for IE

    /**
     * documentMode is an IE-only property
     * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
     */
    var msie = document.documentMode;
    
    if (msie < 9) {
        // code for IE < 9
    }
    

提交回复
热议问题