I’ve been using Dajaxice with my Django based site as it has been very convenient.
However, I sometimes need to cancel the Ajax requests and I don’t know how to do it when the requests are wrapped with Dajaxice.
The documentation for Dajaxice is fairly light – I haven’t found any reference to canceling Ajax requests using the Dajaxice API.
Has anyone had to deal with this?
Should I abandon Dajaxice and go to jQuery Ajax calls?
The pull request for this bug returns the underlying XHR object from
Dajaxice.call. So you should be able to store a reference to the request object and later call it’s.abortmethod to cancel the request.That said, if you are using jQuery anyway I would be inclined to use their AJAX calls. jQuery provides a great deal of flexibility at a higher level of abstraction, as opposed to of working directly with the XHR object. But that’s your choice.