Skip to content

server response warped in <pre> tag #212

Open
@derakhshanfar

Description

@derakhshanfar

First of all thanks for create this plugin, when i want to upload file with iframe method, I get server response like this:
<pre>{success: true, message: 'done'}</pre>
and because of this type of message, parseJSON function can't parse this response to JSON, I've fixed it with this method but i'm not sure this is right solution or no

        var serverResponse = response;
        response = ss.parseJSON(response);
        // if file uploaded with iframe and parseJSON doesn't work
        if (response === false && !XhrOk) {
          var el = document.createElement("html");
          el.innerHTML=serverResponse;
          var tag = el.getElementsByTagName("pre")
          var innerHTML = tag[0].innerHTML;
          response = ss.parseJSON(innerHTML);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions