title: How to show pop-up survey with Jquery when leaving page
body: <p>I want to show survey in pop-up window when users leaves page.</p>
  
  <p>So I want to leave page only when he answers all the questions of survey and/or close the pop-up window... How can I do that?</p>
  
  <p>I try this code</p>
  
  <pre><code>$(document).ready(function () {
          function exitpop() {
              my_window = window.open("http://www.google.com", "mywindow1", "status=off,toolbar=off,location=off,menubar=off,directories=off,resizable=off,scrollbars=off,height=800,width=800");
              });
          }
          $(window).unload(function () {
              exitpop();
          });
      });
  </code></pre>
  
  <p>But it blocks by majority of browsers and don't pause clicked action(going to other page or closing the window). 
  What is the best way to do that?</p>