jQuery & Browser Issues (revisited)
Back in August, I blogged about "three fairly significant browser issues" I had encountered while using jQuery. With the release of jQuery 1.3, and subsequent minor versions, I thought I'd take a look back at those browser issues and see if any of them had been resolved.
Recap: In certain situations, jQuery’s
$.browser.version will report IE 7 as version 6.
Considering the problem is due to IE 7 having an incorrect user-agent, I'm not sure that this problem was up to jQuery to solve. It would have required the user-agent parsing code to check non-user-agent properties...which is probably a bad idea.
I found out that my original code suggestions might fail in situations where IE 6 is using a 3rd party library to add
XMLHttpRequest support, so here are my updated IE 6 and IE 7 detection suggestions:
jQuery.browser.version = jQuery.browser.msie && parseInt(jQuery.browser.version) >= 6 && typeof window['XMLHttpRequest'] == "object" ? "7.0" : jQuery.browser.version;
Add a new
jQuery.browser.msie6 = jQuery.browser.msie && parseInt(jQuery.browser.version) == 6 && typeof window['XMLHttpRequest'] != "object";
Keep in mind that
$.browser is now deprecated, which means it will go away at some point in a future release. I'm not going to get into the object detection vs browser sniffing debate, but just be aware!
Recap: Opera, in an effort to follow standards, changed where it was storing the value for the viewport height.
Safari 3 (Windows)
Recap: The following element would not be hidden in Safari:
I found out that this issue also occurs in Safari 4! The original jQuery ticket I mentioned was marked as a duplicate, but the issue was fixed in ticket 1239.