I have an ajax function that I am calling. While the Webserver is churning away on the Assynchronous request I want to block the div the user is view so he doesn’t press any buttons or anything while that request is going on… I have done this before, and you simply would pick the dive you want to block with an animation, call .block and then when values successfully return you would simply unblock. Like so…
function animateSpinner() {
$("#list").block({ message: '<img src="../../Images/ajax-loader.gif" />' });
};
and then simply call
$("#list").unblock({ message: '<img src="../../Images/ajax-loader.gif" />' });
once you successfully return.
however, I am getting this exception whenever I attempt to do this…
That is for the unblock part of it. Which I forgot to comment out (I was simply testing the ajax portion of this.
Should these kind of calls be wrapped in a document.ready or something to ensure that they should be called. I recently have had issues with ajax submits not working because they were not wrapped in $(document).ready calls and I would like to see if this is another instance of when something should be wrapped in that call?
As stated in the comments there is no such function as
blockon JQuery. You should use thebeforeSendfunction in your AJAX request to setdisabled=truefor the buttons, or change the div’sz-indexto a negative value