Calling abort() on Backbone model fetch
I've read that the return value from a Backbone model fetch statement is a jqXHR object, and that you should be able to abort it like so:
var xhr = myBackboneModel.fetch();
// ....
xhr.abort();
However, I get a 'Uncaught TypeError: undefined is not a function' error when trying to call abort. Inspecting xhr shows it contains a number of other methods (promise, resolve, fail, and a lot more) but no abort.
I'm using Backbone 1.1.0. Any idea what could cause this...?
链接地址: http://www.djcxy.com/p/67086.html