Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: 'undefined' is not an object (evaluating '$.browser.msie') [duplicate]

Tags:

jquery

Possible Duplicate:
jQuery latest $.browser

There was an error with jQuery 1.9 and $.browser; It returns 'undefined' for any $.browser; function. What i did wrong?

TypeError: 'undefined' is not an object (evaluating '$.browser.msie')

I use following code:

setTimeout(function(){if($.browser.msie){$('.ovy').animate({top:"0"},ct);
like image 419
Aleksov Avatar asked Jan 25 '13 08:01

Aleksov


3 Answers

$.browser have been removed from 1.9. You can use jQuery Migrate to have $.browser support.

like image 110
Marwelln Avatar answered Oct 19 '22 08:10

Marwelln


I solved this problem like this

if(navigator.appVersion.indexOf("MSIE") !== -1){
    // Only MSIE will evaluate this code
}
like image 38
Aleksov Avatar answered Oct 19 '22 06:10

Aleksov


$.browser has been removed as of jQuery 1.9. If you want to continue making use of it, you'll need to use the jQuery migrate plugin.

like image 2
Ohgodwhy Avatar answered Oct 19 '22 08:10

Ohgodwhy