title: Using onbeforeunload without dialog?
body: <p>I'm trying to post data when a user leaves my page. I have finally managed to find a working solution, however, it shows a confirmation dialog when the user leaves. I have tried <code>return null;</code> but it didn't work. Is it possible to disable the dialog?</p>
  
  <pre><code>window.onbeforeunload = function() {
      $.post("track.php", {
          async: false,
          refid: refid,
          country: country, 
          type: type,
      });
  
      return '';
  }
  </code></pre>