Uncaught TypeError: Cannot call method 'abort' of undefined on line 218
line 218 Uncaught TypeError: Cannot call method 'abort' of undefined
The requests are going through as expected, but I get that error message.
I'll probably just add a typeof check there, but I wanted to bring it to your attention.
My AJAX request looks like the following:
var xhr = reqwest({
url: url,
data: options,
dataType: 'jsonp',
type: 'jsonp',
timeout: this.opts.timeout,
crossDomain: true,
success: function(resp) {
callback.success(resp);
},
error: function(resp) {
if (error_timeout) {
clearTimeout(error_timeout);
}
callback.error(resp);
}
});
Thanks,
Troy
The following gets rid of the error:
Reqwest.prototype = {
abort: function () {
if( typeof this.request !== 'undefined' && typeof this.request.abort === 'function' ) {
this.request.abort();
}
}
...
hmm... could be that you have that combo of jsonp and crossDomain both set. remove the crossDomain and see if it still throws the error
but yeah, you're right on that... jsonp requests aren't XHR objects, which of course don't have abort methods... so yeah we'll have to fix that
@ded issue is an old one and running into this on IE8,9.