Created
September 11, 2015 04:18
-
-
Save des1roer/617a78a20dc79ade8b4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (elem, datename, date, j, deferreds) { | |
deferreds.push( $.ajax({ | |
type: "POST", | |
url: url, | |
dataType: "json", | |
success: function (data) { | |
date[datename][j] = data; | |
} | |
}) ); | |
})(elem, datename, date, j, deferreds); | |
} | |
$.when.apply($, deferreds).done(function () { | |
/* здесь код, который должен выполниться по окончанию всех аякс-запросов */ | |
for (var elem in deferreds) { | |
console.log(deferreds[elem]); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment