jquery-form/form

Forms plugin is breaking after Chrome 83 update

krishnan-unni opened this issue · 4 comments

Description:

I am facing issues with the plugin after updating to Chrome 83. Previously during a file upload operation there is a iframe attached to the document and then the serialized data is added to the <textarea> element in it, but after the update the textarea element is not present anymore and hence the parseJSON in the httpData is failing and throwing error.

It looks like the load callback (cb) function is called before the XHR request is complete that serialize the form data into json and updates the iframe that's created dynamically by the jQuery plugin. As a result the response is considered invalid.

In Chrome 83 the ready state is 'loading' when the callback is triggered.
Pre Chrome 83 the ready state is 'complete' when the callback is triggered.

var state = getDoc(io).readyState; in checkstate function is "loading" while for previous versions it was "completed".

Expected Behavior:

File should upload properly.

Actual behavior:

Getting error : "SyntaxError: Unexpected end of JSON input"
since serialized data =""

Versions:

4.2.2

jQuery:
jquery-3.4.1

Browsers:
All chrome browser with version 83

Steps to reproduce:

Create a form with jquery form to upload a file. iframe should have src = "javascrip:false" . When you select the file to upload and click OK you'll get the error. "SyntaxError: Unexpected end of JSON input"

Sounds like it's probably the same as #571 ?

I saw the description and actual behaviour for #571 is different from mine. I didn't want to muddle that, hence raised a new one with details. If we find both to be the same we can close this.

@krishnan-unni Would you please confirm if your issue is Fixed by #572 ?

It is. Closing it.