I have function like this:
function update_List(){
LIST=[];
$.each(feed_urls,function(index,value){
$.getJSON(value, function(data) {
$.each(data.feed.entry,function(i,val){
LIST.push(val.content.src);
});
});
});
some_function();
}
The problem is that some_function(); gets called before LIST gets fully updated .
How can I resolve this ?
I tried using custom events , and I also looked up some things on callback , but nothing has really helped .
EDIT: I want some_function() to be called only after all the getJSON calls have completed.
If you want to call the function after all Ajax calls are completed, you should use deferred objects: