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

后端 未结 12 1883
生来不讨喜
生来不讨喜 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:23

    This is probably going to get voted down, because it's not directly answering the question, but... You should not be writing browser-specific code. There's very little you can't do while coding for most widely-accepted browsers.

    EDIT: The only time I found it useful to have conditional comments was when I needed to include ie6.css or ie7.css.

提交回复
热议问题