title: Preventing onbeforeunload dialogs in IE9
body: <p>I'm having an issue in IE9 with onbeforeunload   -- when the code below is run it repeatedly brings up a dialog asking if you want to stay or leave the page.</p>
  
  <p>I modified my code to prevent default functioning based on <a href="https://stackoverflow.com/questions/7263309/onbeforeunload-event-is-too-enthusiastic-in-ie9">this thread</a> to no avail.</p>
  
  <p>Any help on this would be much appreciated.</p>
  
  <p>Code Sample:</p>
  
  <pre><code>window.onbeforeunload = function(e) {
      e.preventDefault();
      e.returnValue = false;
      saveFormData();
      return null;
  }
  
  function saveFormData() {
      $.post("&lt;?php echo site_url('resume/cleanup'); ?&gt;", { resume_id: "&lt;?php echo $this-&gt;session-&gt;userdata('resume_id'); ?&gt;" } );
  }
  </code></pre>