Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind/unbind deprecated in jQuery 3 #120

Closed
wants to merge 1 commit into from

Conversation

mariusconjeaud
Copy link

As of jQuery3, bind() and unbind() methods are deprecated. Replaced by on() and off() methods as required.

As of jQuery3, bind() and unbind() methods are deprecated. Replaced by on() and off() methods as required.
@liabru
Copy link
Owner

liabru commented Jun 30, 2016

The reason for using bind was for back compatibility. Maybe there's a way to detect?

@priley86
Copy link

priley86 commented Aug 5, 2016

+1, would like to see this fix so our patternfly project can support jQuery v3.

@andresgalante
Copy link

👍

@priley86
Copy link

Hi @liabru, please consider that on() and off() are supported in jquery 1.7+

This should give your library adequate support for each major version of jquery currently in use (jquery 1, 2, 3). jquery 1.7 should still provide adqeuate support of IE 6,7, and 8.
See https://api.jquery.com/category/version/1.7/

Please re-consider merging this PR 😄

@liabru
Copy link
Owner

liabru commented Sep 13, 2016

Might it be possible to do something like:

var on = $.fn.on ? 'on' : 'bind';

$(window)[on](function() {
  // ...
});

To maintain backwards compatibility, as this plugin has widespread usage on many older codebases. I'd rather not drop support for them if I can easily keep it, if that makes sense?
I'll try this out when I can.

@rylan
Copy link

rylan commented Sep 22, 2016

If the project is using semantic versioning, another approach to supporting backwards compatibility is to bump the version into the 1.0.0 (meaning major change) and those needing backward compatibility for jquery versions older then 1.7 lock into the 0.7.X version.

@Preen
Copy link

Preen commented Jan 30, 2017

yes?

@liabru liabru closed this in e468ae9 Feb 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants