How to detect if a request was aborted?

Viewed 21257

I am making a request and then right after it I abort.

var x = $.get(url, function (d, e, xhr) { alert(d); });
x.abort();

The problem is that it executes the success function and returns empty data... (example here)

Is there a jQuery method to abort? or Is there a way to check if the xhr was aborted?

4 Answers
Related