I use the following snip of a script:
if ($.browser.msie && $.browser.version < 9) {
extra = "?" + Math.floor(Math.random() * 3000);
}
It works fine with jQuery 1.8.3.
Now I updated jQuery to the new version 1.9.1 to use a new script.
Now I get the following error:
TypeError: Cannot read property 'msie' of undefined
I read the change log of the new jQuery version, but nothing should have changed
with msie
Any known bugs, tips or proposals?
Include jQuery migration plugin along with your jQuery library.
For simple IE detection I tend to use:
Visit the Microsoft Developer Network to learn about the IE useragent: http://msdn.microsoft.com/library/ms537503.aspx
The jQuery.browser options was deprecated earlier and removed in 1.9 release along with a lot of other deprecated items like .live.
For projects and external libraries which want to upgrade to 1.9 but still want to support these features jQuery have release a migration plugin for the time being.
If you need backward compatibility you can use migration plugin.
I had this problem as well. We were using two versions of Jquery (1.11.3 and 1.8.3), one of which was causing this issue. I found a lightbox_me.js release that worked on both versions:
http://buckwilson.me/lightboxme/
It was just an easy replacement of an old file.
$.browser
was deprecated in version 1.3 and removed in 1.9You can verify this by viewing the documentation.
Using this:
if (navigator.userAgent.match("MSIE")) {}