"Are You Sure You Want To Leave This Page" help
I have the following code to popup the "Are you sure you want to leave this page" message:
<script type="text/javascript">
var popit = true;
window.onbeforeunload = function() {
if(popit == true) {
popit = false;
return "Are you sure you want to leave this page?";
}
}
</script>
The problem is that I see the popup even when I click on internal links and internal pages.
How do I make the popup appear ONLY when a user closes the browser tab?
Thanks.
Generate thousands of leads in any niche in under 60 seconds!
Team eLuminous
Front End Development |
Web Application Development Company |
Hire SEO experts