views:

86

answers:

2

Is it possible to set async:false to $.getJSON call.... Any suggestion....

A: 

I don't think you can set that option there. You will have to use jQuery.ajax() with the appropriate parameters (basically getJSON just wraps that call into an easier API, as well).

Daff
A: 

You need to make the call using $.ajax() to it synchronously, like this:

$.ajax({
  url: myUrl,
  dataType: 'json',
  async: false,
  data: myData,
  success: function(data) {
    //stuff
  }
});

This would match currently using $.getJSON() like this:

$.getJSON(muUrl, myData, function(data) { 
  //stuff
});
Nick Craver