Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Merge data from many AJAX requests
function aj( url ){
return $.ajax({
url: url,
success: function( data ){
}
);
}
function resolve( args ){
//Create call $.when( url1, url2, url3 )
var defer = $.when.apply( $, $.map( args, aj ) );
return defer.pipe(function(){
//Return data instead of success arguments
// (data,status,browser ajax obj)
return $.map( arguments, function( n, i ){
return n[0];
});
});
}
resolve(['url1','url2','url3'])
.then(function( url1data, url2data, url3data ){
//Will map to console.log above
console.log( 'then', arguments );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.