I've been attempting to display a loading gif while an ajax call is in progress. However, I encountered an error at the show statement and the console displayed:
TypeError {stack: (...), message: "undefined is not a function"}
Here's my code snippet:
require(["dojo/_base/xhr"], function(xhr) {
xhr.get({
url: uri,
handleAs: "text",
load: function(data) {
require(["dojo/dom-construct", "dojo/_base/window"], function(domConstruct, win) {
domConstruct.place("<div id='loadgif'><img src='/22.gif' ></img></div> ", win.body());
});
dojo.byId("loadgif").show();
console.log(data);
txt = data;
console.log(txt);
console.log(txt.split("/")[0]);
console.log(txt.split("/")[2]);
dojo.byId("loadgif").hide();
},
error: function(error) {
console.log("error");
}
});
});