$.ajax({
url: "/cgi-bin/stats.exe",
method: "post",
async: false,
data: { refresh: "a41" }
});
Using ajax post synchronously – “async: false”.
While it blocks the browser during the active request, what is the most efficient way to change the cursor to the hourglass or display a wait .gif?
Perhaps set the cursor as it enters this function then change it back in the success or complete function?
Any advice is appreciated.
Thank You.
I recommend using the jQuery blockUI plug-in. It will change the cursor, show any message or icon (http://ajaxload.info/) you like while the user is waiting. There’s lots of info on the website for how to use it, but in its simplest form:
That will automatically show the wait cursor and prevent user activities until the ajax call completes.