Skip to content

IE XDR Support breaks jQuery AJAX calls with custom dataTypes #31

@mithusree

Description

@mithusree

$.ajaxTransport code added in the plugin support Microsoft XDR Support #18
is causing problems with $.ajax with custom ajax return data types like JSON.

For eg;

Whenever jquery.xmpp.js is included,

$.ajax({
        url: 'api.php',
        type: "POST",
        cache : false,
        dataType: "json",
        data : {
            username : "aaa",
            password : "bbb"
        },
        success : function(response) {
            console.log("AJAX Success");
            console.log(response);
        },
        error : function(jqXHR, textStatus, errorThrown) {
            console.log("AJAX Error");
            console.log(jqXHR);
            console.log("Status code: " +jqXHR.status);
            console.log(textStatus);
            console.log(errorThrown);
        }
    });

error call back is always executed, and the jqXHR.status will be 400 even if server responds with

header('HTTP/1.1 200 OK');

Better XDR support script can be found here
https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest

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