I think/hope I am missing something regarding the promise programming paradigm. I run the following code on jQuery because I want to get the data from URL_1 and then (on success) to get the data2 from URL_2. The other variables come the the context surrounding this piece of code.
However, what I get is the data of the URL_1 twice!!
.ajax({
url: URL_1,
type: "GET",
async: false,
cache: false
}).then(function (data) {
myObj = process(otherObj, data, URL_1);
return $.ajax({
url: URL_2,
type: "GET",
async: false,
cache: false
});
}).done(function (data2) {
myObj2 = process_more(data2, URL_2, someObj);
myCounter--;
if (myCounter== 0) {
console.log("%%%% COMPLETE %%%%");
}
});
Thank you in advance for your time!!
Pan