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

Enhancements needed to to be fully compatible with jQuery 3 #544

Open
kevindb opened this issue Mar 3, 2018 · 8 comments
Open

Enhancements needed to to be fully compatible with jQuery 3 #544

kevindb opened this issue Mar 3, 2018 · 8 comments

Comments

@kevindb
Copy link
Contributor

kevindb commented Mar 3, 2018

jQuery 3 is removing a lot of features that have been depreciated for a long time. Some of these are still in use by jQuery Form.
https://jquery.com/upgrade-guide/3.0/

I have very little experience working with jQuery Deferred or Promises, so pull requests and assistance in updating jQuery Form is greatly appreciated.

Known issues

  1. Incompatible with jQuery 3 slim build #541 success and error Deferred methods
    https://jquery.com/upgrade-guide/3.0/#breaking-change-special-case-deferred-methods-removed-from-jquery-ajax
  2. .selector property is removed #353 .selector property
    https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed

Other related issues:
#527 feature for Deferred
#401 Submit only if a promise is resolved

@arirangz
Copy link

Hi Kevin!

Thanks for this great plugin!

Do you have any progress on updating it for jQuery 3?

I have an issue using it, the selector is not working good :
$('form#myFormID').ajaxForm({ will trigger submit of any form in the page even forms with another ID.

Thanks

@arirangz
Copy link

arirangz commented Jun 29, 2019

Hi again,

I am not a pro on github so I create a fork and modified the code to work with jquery 3 :
https://github.com/arirangz/form/blob/master/src/jquery.form.js

I replaced this.selector (which is now obsolete) by options.selector. So we need to provide the selector as an option :
$('form#myID').ajaxForm({
selector: 'form#myID',
target: '#myTarget',
delegation: true,
type: 'post',
....

I don't know if it's the best way but it works for me

Cheers

@uthirapandian
Copy link

Hi, any update on this? We are also upgrading our website to jQuery 3.3.1 and seeing issues with jQuery form plugin. Please let us know.

@JamoCA
Copy link

JamoCA commented Aug 14, 2020

Another warning from JQueryMigrate jQuery.isFunction() is deprecated and jQuery.trim is deprecated; use String.prototype.trim.

$.trim(action) can be replaced with action.trim().

isFunction is used in 3 places. According to the jQuery documentation, this can be replaced with (typeof x === "function")

@pacmanito
Copy link

pacmanito commented Nov 18, 2021

@kevindb hi, guys. The library is used in Wordpress and it is one of the last ones with deprecated jQuery code, can you please replace the left instances of $.isFunction and make and update?

@yasnaderi
Copy link

yasnaderi commented May 26, 2022

Hi @kevindb ,
The context property is removed in JQuery 3.0.

Do you have any plan to update the plugin to be compatible with JQuery 3.5?

Thanks

@indigoxela
Copy link

indigoxela commented Jul 29, 2023

It seems like @xaabi6 sneaked in last autumn and provided a pull request, that fixes all the deprecation nagging.

@kevindb any chance, that you're having a look? The code changes seem reasonable and would be a big step forward.

@yookoala
Copy link

Any update to this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants