list - Ordering Ajax Calls -
i want ajax calls being made in particular order, let me explain further using code.
var feed_urls = [ 'url_1', 'url_2', 'url_3', ... ... 'url_n', ];
i making ajax calls using jquery's getjson
method so
$.each(feed_urls,function(index,value){ $.getjson(value, function(data) { $.each(data.feed.entry,function(i,val){ list.push(val.content.src); }); }); });
the problem facing since ajax calls asynchronous content of list
not in same order. there anyway solve ?
the preferable order of ajax calls url_1
followed url_2
followed url_3
, on till url_n
use ajaxsetup() async :false, in re:
$.ajaxsetup( { data: "{}", async false, ..whatever else need
Comments
Post a Comment