Giter Club home page Giter Club logo

Comments (6)

mitchlloyd avatar mitchlloyd commented on August 25, 2024

I'm also struggling with this error. The error only seems to occur when there is a file input in the form.

from form.

jlsandell avatar jlsandell commented on August 25, 2024

I've run into this as well. Again, it only occurs during a file upload (due to the iframe I'm guessing).

from form.

galdosd avatar galdosd commented on August 25, 2024

I am having the exact same problem. I tried debugging it and I believe the problem is on line 264 of jquery.form.js:

$io.appendTo('body');
$io.data('form-plugin-onload', cb);

It seems that if the load event triggers sufficiently quickly, the 'form-plugin-onload' data on the element will not yet be set, so an attempt is made to call something that is not a function. As a result the callback is not called at all.

I simply swapped the two lines and that fixed the issue completely for my purposes. I also doubt that that could cause any other bugs, however, I didn't have time to test it more thoroughly, and it's possible I'm misunderstanding something about the jquery forms plugin or jquery, so someone should at least run the test suite through it before committing. In the meantime, to the two of you who were having the same problem, you can just swap those two lines in the jquery form code:

$io.data('form-plugin-onload', cb);
$io.appendTo('body');

and hopefully you'll be lucky too. Best wishes!

Patch follows:

262a263,265
>                               // save the callback so the iframe can get it
>                               // we need to do this *first* (see github issue #22)
>                               $io.data('form-plugin-onload', cb);
265d267
<                               $io.data('form-plugin-onload', cb);`

from form.

shad42 avatar shad42 commented on August 25, 2024

I can confirm the bug.

@galdosd: Unfortunately, your workaround does not fix the bug at all. :(

from form.

mishermasher avatar mishermasher commented on August 25, 2024

I found that if the server-side script returns some text in the response then this error doesn't occur. I didn't look closely at the source to see why this is true, but I thought I'd share.

from form.

malsup avatar malsup commented on August 25, 2024

Can someone post a simple test page that shows the problem? Thanks.

from form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.