If you set async
to false
, the browser will halt the execution of everything while the ajax request is served. Although beforeSend
does execute before the ajax request is sent, the synchronous request may occur so quickly that the browser doesn't actually refresh the screen and show your $.blockUI
changes. You do get to see them for a very short time after the ajax completes (when they are removed immediately).
If you must use async, you may be able to get around this by calling $.blockUI
separately and setting a short timeout (100 MS perhaps) before starting the ajax request.