I need to call a javascript function which returns the content of an ajax call.
In order to achieve this result I set async option to false in ajax call.
function ajaxQuery(){ var content; $.ajax({ url: "blabla.html, async: false, success: function(data){ content = data } }); return content; }
Unfortunately, setting async option to false make blockUI not working properly. During the query to the server, the browser is frozen with no message.
If I set async option to true the blockUI comes to work properly but my javascript function return the value undefined, probably because the ajax query is not finished.
How to solve this problem in javascript function to get the content of the ajax call making blockUI working?
Thanks,
Antonio