如何使用 dojo 一个接一个地执行两个 xhr.gets ?
我有 ....
require(["dojo/_base/xhr", "dojo/dom", "dojo/domReady!"],
function(xhr, dom) {
// Using xhr.get, as very little information is being sent
xhr.get({
// The URL of the request
url: "inc/etl2json.php?item=Execs",
// The success callback with result from server
load: function(execContent) {
dom.byId("Execs").innerHTML = execContent;
},
// The error handler
error: function() {
// Do nothing -- keep old content there
}
});
});
我想对"inc/etl2json.php?item=Execs"做另一个 xhr.get并将其分配给dom.byId("Elapsed").innerHTML = elapsedContent;