title: onbeforeunload event parameter and empty return value
body: <p>Q1: I have seen the following code in most sources:</p>
  
  <pre><code>window.onbeforeunload = function () {
      return 'You might lose your data!';
  };
  </code></pre>
  
  <p>For example:</p>
  
  <ol>
  <li><a href="http://msdn.microsoft.com/en-us/library/ie/ms536907(v=vs.85).aspx" rel="nofollow noreferrer">beforeunload | onbeforeunload event (Internet Explorer)</a></li>
  <li><a href="http://help.dottoro.com/ljhtbtum.php" rel="nofollow noreferrer">onbeforeunload event | beforeunload event JavaScript</a></li>
  <li><a href="https://stackoverflow.com/a/276739/478018">javascript - How can I override the OnBeforeUnload dialog and replace it with my own? - Stack Overflow</a></li>
  </ol>
  
  <p>But on <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window.onbeforeunload#Example" rel="nofollow noreferrer">MDN</a> the function has an extra parameter: <code>(e)</code>. Why is that, what is the difference, and which is right?<br>
  <br>
  Q2: It seems that any browser has a default confirmation message that you cannot customize. Chrome, for example, displays:</p>
  
  <blockquote>
    <p>Are you sure you want to leave this page?</p>
  </blockquote>
  
  <p>Can I content myself to this message and leave the <code>return</code> value empty:</p>
  
  <pre><code>return '';
  </code></pre>