title: How to disable dialog alert and close the website in window.onbeforeunload?
body: <p>How can I disable dialog alert and close the website in <code>window.onbeforeunload</code>?</p>
  
  <pre class="lang-js prettyprint-override"><code>window.onbeforeunload = function() {
    var isVisible = $('#submitbtn').is(':visible');
    if(isVisible==true){
      return null;
    }else{
      return 'you havent close';
    }
  </code></pre>