title: window.onbeforeunload detect if POST or GET
body: <p>In the window.onbeforeunload event is there a way to detect if the new request is a POST(on the same page) or a GET(going to a page)? It would also be great to see the new document.location.</p>
  
  <pre><code>window.onbeforeunload = winClose;
  function winClose() {
      //Need a way to detect if it is a POST or GET
      if (needToConfirm) {       
          return "You have made changes. Are you sure you want?";
      }
  }
  </code></pre>