$(document).ajaxStart() takes a reference to a function as an argument.
It provides a function for jquery to invoke in the future, when an ajax call starts.
This is why the version that works is $document.ajaxStart($.blockUI)
and not $document.ajaxStart($.blockUI())
Your second version, $.document.ajaxStart($.blockUI({message: 'wait...'})
is functionally equivalent to $document.ajaxStart($.blockUI())
- it is invoking the blockUI function immediately, not providing a reference to it.
The easiest (maybe not the best) way to fix this, if you don't want to change the default blouckUI message, is to wrap it in another function, something like this:
var ajaxBlock = function() { $.blockUI({message: 'wait...'}) }
$(document).ajaxStart(ajaxBlock);