Test case for jQuery Ticket 8193

jqXHR.abort() in prefilter

by jitter

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>

JavaScript

$.ajaxPrefilter("json", function(options, originalOptions, jqXHR) {
    console.log("trying abort");
    jqXHR.abort();
});

$.ajax({
    url: "/echo/json/",
    type: "POST",
    dataType: "json",
    data: {
        json: '{ "foo" : "bar" }'
    },
    success: function() {
        console.log("success");
    },
    error: function() {
        console.log("error");
    },
    complete: function() {
        console.log("complete");
    }
});