3
I’ve seen the official documentation here and I do not see mention that the default value is asynchronous or synchronous, I see no example of how to use both (in the second code below).
I know it works that way:
$.ajax({
url: url,
async: false,
data: data,
success: success,
dataType: dataType
});
The following code does not exist async
?
$.get( "test.cgi", { name: "John", time: "2pm" } )
.done(function( data ) {
alert( "Data Loaded: " + data );
});
The second code do not know if the default value async
is as true
or false
.
And if I want to use like
false
?– Matheus Miranda
Which jQuery version do you use?
– Jean Gustavo Prates
,the most recent
– Matheus Miranda
With $.get you can only change this behavior with ajaxSetup. (e.g. jQuery.ajaxSetup({async:false});), which is not recommended.
– Jean Gustavo Prates