title: How to execute JQuery BEFORE Safari submits form
body: <p>I've run into an issue that only seems to a problem in Safari. I have an overlay that is set to <code>display:none</code> in it's css. When the user clicks submit I want the overlay to show until processing is finished. I did this initially by just binding this to the button's <code>on('click'...</code> function in jquery. This worked just fine except in Safari. Safari wants to execute the submit before the calls in the click. So, based on some other things I found I instead put this all on the submit event for the form instead of the click and used a timeout object set to 0. Like this:</p>
  
  <pre><code>$('#tcmi-shop-cart-checkout').submit(function(){
      var showOverlay = function(){$('#processing-overlay').css('display','block')};
       setTimeout(showOverlay,0);
  });
  </code></pre>
  
  <p>This, again, works in all other browsers except Safari. Safari still wants to submit the form data and wait for a response before it executes this. How can I make Safari show this overlay BEFORE submitting the data?</p>