I am using jquery’s $.getJSON method to get two json file.
This is simple structure of my code
$.getJSON(url1, function(data) {
//some code
}
$.getJSON(url2, function(data) {
//some code
}
fillList();
I want that to call the fillList() method only after both the json data succesfully loaded.
What is the simplest method to do that ?
jQuery deferred object can help you, even i didn’t test it, but try below
or there isn one example on .getJSON