$(window).load(function () { if($.browser.msie && $.browser.version=="6.0") { // do stuff } });
刚刚意识到$ .browser已经在1.3中被折旧了。什么是检测IE的新方法,特别是IE6。
解决方法
jQuery documentation for
jQuery.browser
显示以下警告:
We recommend against using this property,please try to use feature detection instead (see 07001).
> $ .support.Boxmodel在IE 6和7中为false。
> $ .support.cssFloat对于IE 6,7和8为false;这在IE 9中是正确的。
> $ .support.leadingWhitespace对于IE 6,7和8为false。
> $ .support.objectAll对于IE 6,7和8而言当前为false。
请注意,文档中显示以下注释:
jQuery comes with a number of properties included,you should feel free to add your own. Many of these properties are rather low-level so it’s doubtful that they’ll be useful in general day-to-day development,but mostly used by plugin and core developers.