user979331
user979331

Reputation: 11861

jQuery switched to 1.11.1 from 1.7.1 and now I get an error: Uncaught TypeError: undefined is not a function

I recently switched from jquery 1.11.1 from 1.7.1 and now I am having an issue with some old code:

$('#searchtext').autocomplete({source:'search.php'});

and if I comment that out, I get an error on this line:

$("#top").live('click',function(){
    $('html, body').animate({scrollTop:200}, 'slow');
    return false;
});

I have no document ready or load at the top of this code, but when I did that I ran into the same issue. :( Any suggestions.

Upvotes: 0

Views: 179

Answers (1)

gskema
gskema

Reputation: 3221

.autotomcomplete() function comes from jQuery UI library, it's doesnt come from jQuery lib. jQuery UI is a dependency and autocomplete is a plugin which you may download seperately but it will still require jQuery UI.

As for .live() function, you should rename it to .on() (it is the preferred method in the newer versions of jQuery), .live() is deprecated.

Upvotes: 1

Related Questions