Search

9/10/2010

yui synchronousCall


function synchronousCall() {
var args = [].slice.call(arguments);
var iter = function (args) {
var fn = args.shift();
if (fn && fn.call()) { // return true means no ajax call is made, excute next
iter(args);
}
};

iter(args);

Connect.completeEvent.subscribe(function (type, data, args) {
console.log('completeVent', args)
iter(args);
}, args);
}

沒有留言: