title: jQuery blockUI and AJAX POST
body: <p>I am using jQuery BlockUI in a project. For a particular user action, I want to block the UI, and then POST data to the server. When the timeout event occurs OR the server returns, I want to unblock the page.</p>
  
  <p>I can't seem to implement this behaviour. This is what I have so far (not working)</p>
  
  <pre><code>$(document).ready(function(){
      $('#test').click(function(event){
          $.blockUI({ message: $('#mydiv') });
  
          $.ajax({
                type: 'POST',
                url: 'www.example.com',
                data: somedata,
                dataType: "json"
          });
  
          setTimeout(function() {
                  $.unblockUI({
                      onUnblock: function(){ 
                          alert('onUnblock');
                      }
                  });
              }, 2000);
  });
  </code></pre>
  
  <p>can anyone spot what I may be doing wrong?</p>