title: Prevent the "Confirm Navigation" dialog box from popping up on page leave
body: <p>It seems this question has been asked a fair amount, but never resolved.</p>
  
  <p>I want to prevent this dialog box (image attached) from appearing when leaving the page. The alert happens every time I change something in the form on this page, but the form is saving asynchronously, so no changes are actually "dirty" so to speak.</p>
  
  <p><img src="https://i.stack.imgur.com/t4kHo.png" alt="Confirm Navigation dialog box"></p>
  
  <p>I've tried a couple things found on stackoverflow and other sites, such as the following:</p>
  
  <pre><code>window.onbeforeunload = null;
  
  window.onbeforeunload = function(e) { 
      e.returnValue = '';
      return false;
  }
  
  window.onbeforeunload = function(e) { 
      history.go(0);
  }
  </code></pre>
  
  <p>Some advice on how to remove this would be greatly appreciated.</p>
  
  <p><strong>Edit</strong>: As requested, here is a code sample of what I'm trying. There is other code within the file, but nothing to do with it.</p>
  
  <pre><code>;(function($) {
      // doc ready
      $(function(){
          // Remove the alert
          window.onbeforeunload = null;
      });
  })(jQuery);
  </code></pre>