Skip to content

Forms plugin is breaking after Chrome 83 update #573

Closed
@krishnan-unni

Description

@krishnan-unni

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions