I need a help in exist Pop Blocker which block closing a site and it should Not block any internal webpage function.
Example site URL : http://beyondhosting.net/Dedicated-Cloud-Servers/Managed-Servers/ (I need same as this URL Exist Pop contain)
It only Block on close, Not in refresh, going to different link and Internal webpage functions.
Can anyone please help me with Exist Pop blocker code which Block only on Tab or window close.
Currently i am trying
<script>
a = document.getElementById('audio');
a.onended = function(){setTimeout("a.play()", 1000)}
</script>
<script type="text/javascript">
var hook = true;
window.onbeforeunload = function() {
if (hook) {
return "Did you save your stuff?"
}
}
function unhook() {
hook=false;
}
</script>
<div Onclick"Unhook"></div>
But it not performing well, It blocking another internal link, external link and even refresh, But i need it should only block on exist or closing tab or window and it should allow everything. I have provide Example URL which are using the script like i want, But i unable to find it.
Thanks in advance.