I inserted this so that it shows up on every ajax call, no matter what I have (I have several)
var loadingMessage = 'Please wait loading data for ' + defaultPageDoctor; $(function() { $("#Errorstatus") .bind("ajaxSend", function() { $(this).text(loadingMessage); $(this).show(); }) .bind("ajaxComplete", function() { $(this).hide(); }); });
Just create an element with id #ErrorStatus, for example:
<div class="newProcedureErrorStatus ajaxLoading " id="newProcedureErrorStatus"> <span id="Errorstatus" class="ui-state-error-text newProcedureErrorStatusText"></span> <span id="Errorstatus2" class="ui-state-error-text newProcedureErrorStatusText"> </span> </div>
Now for bonus rounds you can use this area to place other messages, I also turned on the timer:
var saveMessageText = 'Saving...'; function ShowStatus(saveMessage, message, timeInMilliseconds) { var errorMessage = $("#Errorstatus"); if (saveMessage) { errorMessage.show();
use it like this:
ShowStatus(true, 'Save Failed with unknown Error', 4000);
source share