On jquery website they tell you that you can do this:
jQuery.ajax({
type: "POST",
url: 'http://example.com',
success: function(result) {
},
async: false
});
And this will make this call synchronous
but what if I am using the jquery format to post:
$.post( '../php/x.php', {},
function( data ){ // a function to deal with the returned information
}
}, "json");
How can I make this synchronous?
You probably shouldn't be making it synchronous anyway, but you can't. An approximation would be
$.ajaxSetup({async: false});
$.post();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With