Changed jQuery.getJSON to jQuery.ajax for asynchronous call