5
¿Dojo xhrPost/xhrGet tiene una función de devolución de llamada equivalente como jQuery beforeSend?devolución de llamada de Dojo antes de AJAX
¿Dojo xhrPost/xhrGet tiene una función de devolución de llamada equivalente como jQuery beforeSend?devolución de llamada de Dojo antes de AJAX
Puede usar dojo/aspect
.
aspect.before(dojo, "xhrGet", function(args){
args.url = 'index.html?TEST';
return [args];
});
var btn = new Button({label: 'xhr'}, 'btn');
on(btn, 'click', function(evt){
var xhrArgs = {
url: "index.html",
handleAs: "text",
load: function(data){ console.debug(data); },
error: function(error){ console.error(error);}
}
dojo.xhrGet(xhrArgs);
});
muy buena respuesta – Sandeep