How can I determine which version of IE a user is running in JavaScript?

后端 未结 12 1884
生来不讨喜
生来不讨喜 2021-02-04 04:48

In some existing code there is a test to see if the user is running IE, by checking if the object Browser.Engine.trident is defined and returns true.

But how can I deter

12条回答
  •  感情败类
    2021-02-04 05:21

    If you are already using jQuery in a pre-1.9 version AND you don't need to detect IE 11, you can do this:

    if (jQuery.browser.msie == true) { 
    if (jQuery.browser.version == 7.0)
      // .. do something for 7.0
    else 
      // .. do something for < 7.0
    }
    

提交回复
热议问题