How to use Jquery UI with Jquery 3.1

Asked

Viewed 77 times

2

I’m using the Jquery UI 1.12 with the Jquery 3.1.1 and using the functions draggable and resizable.

However, always when I test it does not work because it gives the exception

$(...).find(...).andSelf is not a function 

I searched and saw that this was taken andSelf and placed the addBack in the jQuery more current, but there works the jQuery UI, only with the Jquery 1.12. But the site I’m working on had already imported the jQuery 3.1.1 and I can’t touch it because it could cause problems in some function that someone has done before.

What to do to solve this problem?

  • So I researched the jQuery UI 1.12.1 is compatible with jQuery 3.1.0, perhaps a possible alternative would be to migrate to it, since there were few modifications, maybe does not interfere with existing functions (worth the test).

1 answer

0

The .andSelf() was discontinued in jQuery 1.8, details:

Use in his place addBack

If it’s a bug in jQuery ui try upgrading to 1.12.1 (stable current version), if it doesn’t work, just try a hack (gambiarra):

$.fn.andSelf = function() {
     return this.addBack.apply(this, arguments);
};

Browser other questions tagged

You are not signed in. Login or sign up in order to post.