jQuery Ajax Methods Not Returning XHR Object
Posted
by
Nate
on Stack Overflow
See other posts from Stack Overflow
or by Nate
Published on 2011-01-07T21:27:36Z
Indexed on
2011/01/07
21:53 UTC
Read the original article
Hit count: 248
UPDATE: I haven't figured out what's going on, but this definitely seems to be a problem with my project. After creating a simple test page, I was able to verify that getJSON does in fact return an XHR object like it's supposed to.
Per the stackoverflow question/answer here: Kill ajax requests using javascript using jquery. and a number of other question/answers on this site and others, the jQuery Ajax methods should return the XHR object.
However, when I run the following code, request is "undefined".
var request = $.getJSON(url, function(data) {
console.log(data);
});
console.log(request);
Did I miss a change in jQuery? I'm using 1.4.4.
© Stack Overflow or respective owner