RandomSec/main/webapp/scripts/util/ajax.js
Stefano Mazzocchi 365868564f create 'main' and 'server'
git-svn-id: http://google-refine.googlecode.com/svn/branches/split-refactor@905 7d457c2a-affb-35e4-300a-418c747d4874
2010-05-30 16:52:50 +00:00

22 lines
512 B
JavaScript

Ajax = {};
Ajax.chainGetJSON = function() {
var a = arguments;
var i = 0;
var next = function() {
if (i <= a.length - 3) {
var url = a[i++];
var data = a[i++];
var callback = a[i++];
$.getJSON(url, data, function(o) {
callback(o);
next();
}, "json");
} else if (i < a.length) {
var finalCallback = a[i++];
finalCallback();
}
};
next();
};