Ajax uses callbacks because it is A synchronous.
I want my call to the remote URL block until some answer is found , just like in Ajax, but without the asynchronous part, or should I say that I want to make a JAX call.
Is there any method to do the following (uses jQuery) (... a solution with jQuery or something else):
function get_data() { $.ajax({ type : "POST", url : "/foo" }).done(function(data, textStatus, jqXHR) { return data; }).fail(function(jqXHR, textStatus) { return null; }); } var data = get_data();
I'm just curious - I want to study.
In fact, there are times when locking until the answer works well. I'm not saying that I want the browser to lock, only a script.
source share