使用 jQuery 检测 IE
$(window).load(function () {
if($.browser.msie && $.browser.version=="6.0") {
// do stuff
}
});
刚刚意识到 $.browser 在 1.3 中已经贬值了。检测 IE(特别是 IE6)的新方法是什么?
$(window).load(function () {
if($.browser.msie && $.browser.version=="6.0") {
// do stuff
}
});
Just realized that $.browser has been depreciated in 1.3. What is the new method for detecting IE, specially IE6.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
文档中的热门信息:我们建议不要使用此属性,请尝试使用功能检测(请参阅 jQuery.支持)。
hot from the documentation: We recommend against using this property, please try to use feature detection instead (see jQuery.support).
显示浏览器信息
警告正在使用的 IE 渲染引擎的版本。除非包含 jQuery Migrate 插件,否则无法在 jQuery 1.9 或更高版本中工作。
Show the browser Information
Alert the version of IE's rendering engine that is being used. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.
jQuery.browser
的 jQuery 文档显示以下警告。 (重点是我的。)文档页面还说:
甚至
jQuery.support
,这是旧版本建议的文档有以下警告。 (重点是我的。)之前的
jQuery.support
文档报告了以下属性和值。$.support.boxmodel
在 IE 6 和 7 中为false
。$.support.cssFloat
为false
IE 6、7 和 8;在 IE 9 中为true
。$.support.leadingWhitespace
为false
。$.support对于 IE 6、7 和 8,.objectAll
目前为false
。The jQuery documentation for
jQuery.browser
shows the following warning. (Emphasis is mine.)The documentation page also says:
Even
jQuery.support
, which was suggested from the old documentation has the following warning. (Emphasis is mine.)The previous documentation for
jQuery.support
reported the following properties and values.$.support.boxmodel
isfalse
in IE 6, and 7.$.support.cssFloat
isfalse
for IE 6, 7 and 8; it istrue
in IE 9.$.support.leadingWhitespace
isfalse
for IE 6, 7, and 8.$.support.objectAll
is currentlyfalse
for IE 6, 7, and 8.