Thanks for your help everybody, but I'm still having trouble. I've just gone out to the BlockUI page from jquery.com/plugins and re-downloaded the code (the packed version). Here's my code which still isn't working:

<html>
   <head>
       <title></title>
<script type="text/javascript" src="/include/js/jquery-latest.pack.js"></script> <script type="text/javascript" src="/include/js/jquery.block.pack.js"></script>
       <script>
           $(document).ready(function(){
               $().ajaxStart($.blockUI).ajaxStop($.unblockUI);
           });
function myAjaxCall (){
               seconds = Math.abs($("input:text").val());
if(seconds > 20){ alert("I'm not going to let you wait for " + seconds + " seconds.\nTry a number under 20.");
                   return;
               }
               $.ajax({
                   type: "POST",
                   url: "Wait.cfm",
                   datatype: "html",
                   data: "seconds=" + seconds,
                   success: function(data){
                       alert("YAY! You waited " + seconds + " seconds!");
                   },
                   error:function(data){
                       alert("Um... that wasn't supposed to happen.");
                   },
                   complete:function(data){
                       alert("you complete me.");
                   }
               });
           }
       </script>
   </head>
<body>
       <h3>BlockUI Test</h3>
Click the button to wait the number of seconds shown. During that time the UI should be blocked.<br>
       <form name="f">
           <input type="text" name="seconds" value="10">
           <input type="button" value="wait" onclick="myAjaxCall();">
       </form>
   </body>
</html>

Am I still doing something wrong?

Thanks,
Chris



Klaus Hartl wrote:
Mike Alsup schrieb:
I said I was confused yesterday... I have never used them and thought
they work like $.ajaxTimeout. Ok, then make it:

$(document.body).ajaxStart($.blockUI).ajaxStop($.unblockUI);
That will work.  But I still prefer this syntax:

$().ajaxStart($.blockUI).ajaxStop($.unblockUI);

:-)

I wasn't sure about the empty jQuery object. So whenever I need a jQuery stub, I can use $()... On the other hand, because your are blocking the whole document, $(document.body) makes some sense in terms of readability.


-- Klaus


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


--
http://www.cjordan.info

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to