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

Support jQuery >= 3.0 #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

padamson
Copy link

@padamson padamson commented Nov 4, 2022

Close #2

@padamson padamson changed the title support jQuery >= 3.0 Draft: support jQuery >= 3.0 Nov 4, 2022
@padamson
Copy link
Author

padamson commented Nov 4, 2022

Looks like there are some other changes that need to be made, like andSelf -> addBack

@padamson padamson changed the title Draft: support jQuery >= 3.0 Support jQuery >= 3.0 Nov 4, 2022
Copy link
Owner

@mitya33 mitya33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - I appreciate your contribution. However, it's quite duplicative. It's possible to accomplish your edits to support jQuery >= 3 with less code, as follows:

  1. For the addBack() vs. andSelf() thing, instead of repeating the entire blocks of code, you can just do:
$('.foo')[jquery_ver >= 3 ? 'addBack' : 'andSelf']()
  1. For the .error() vs. .fail() part, just use .fail() - that's supported sine v.1.5
  2. Also, please don't feel the need to add extra { and }. This is down to coding style, and mine is not to have unnecessary brackets, though I know many would disagree.

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.

Support for jQuery >= 3.0
2 participants