Since the original question was about jQuery.get
, it is worth mentioning here that (as mentioned here) one could use async: false
in a $.get()
but ideally avoid it since asynchronous XMLHTTPRequest
is deprecated (and the browser may give a warning):
$.get({
url: url,// mandatory
data: data,
success: success,
dataType: dataType,
async:false // to make it synchronous
});