This question has already been answered:
Hello. There is such a JS code:
$(document).ready(function() { $.getJSON('https://...?callback=?', function(data) { //ответ от сервера успешно получаю alert("Im in JSON"); }); alert("Im out JSON"); }); Question: why as a result is the “Im out JSON” alert first executed, and only then “Im in JSON”? Why is this kind of logic "the other way around"?