getJSON Synchronous
Since $.getJSON() uses ajax configurations, just set the global ajax configs: // Set the global configs to synchronous $.ajaxSetup({ async: false }); // Your $.getJSON() request is now synchronous… // Set the global configs back to asynchronous $.ajaxSetup({ async: true });