September 30, 2010

Synchronous getJSON jquery call

What a pain. Here's an easy way to make a synchronous getJSON call with jquery:

var jsonObjectInstance = $.parseJSON(
    $.ajax({
         url: "json_data_plz.cgi", 
         async: false, 
         dataType: 'json'
        }
    ).responseText
);

1 comment: