I want to show survey in pop-up window when users leaves page.
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?
I try this 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();
});
});
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?