I am looking for a DOJO function that runs changes when code is complete similar to this function below:
$(document).ajaxComplete(function() {
// run changes here
});
I have tried:
dojo.addOnLoad(function(){
// run changes here
});
However, I am losing my changes still when there is a DOJO AJAX call. I am not trying to make an AJAX call just to listen for a completed one.
Alternative to ajaxComplete in Dojo is listening to "done" event of dojo/request/notify module
notify("done", function(responseOrError){
// Do something whether a request has succeeded or failed
if(responseOrError instanceof Error){
// Do something when a request has failed
}else{
// Do something when a request has succeeded
}
});
See http://dojotoolkit.org/reference-guide/1.9/dojo/request/notify.html for more details.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.