What I want is to run a code in asynchronous mode to get a faster response (multi-thread).
I have an array like “sources” with feeds and what I want is to get data from each one.
I’ve thought something like this :
$.each(sources, function(key, val) {
JSON CALL OF EACH SOURCE
}
and then group all the results in an array and show them. The problem is that I want the json calls in asynchronous mode due to some of them take some time.
How could I do the ‘each’ in async mode with jQuery ??
Using deferred objects:
To alter the AJAX function so that only the
dataargument is returned, you can use.pipe():