468x60



I hope each and every web surfers are aware of this exit popup function. The purpose why I've used Jquery function here is, "stay on page or leave the page" exit popup can be created without using Jquery but the major drawback of it is, it keeps on showing exit popup even if a user click on any internal link too. So to overcome this drawback, I have used Jquery java-script function here which ensures that the "stay on page" exit popup pops only when the visitor try to leave your site and not when a visitor clicks on any internal link.

I hope each and every web surfers are aware of this exit popup function. The purpose why I've used Jquery function here is, "Stay on page or leave the page" exit popup can be created without using Jquery but the major drawback of it is, it keeps on showing exit popup even if a user click on any internal link too. So to overcome this drawback, I have used Jquery java-script function here which ensures that the "stay on page" exit popup pops only when the visitor try to leave your site and not when a visitor clicks on any internal link.

Stay on Page or Leave this page exit popup

Install "Stay on page" exit popup on blogger

1. Go to blogger dashboard --> Template --> Edit html.

2. Find(Ctrl+F) for </head> tag and place the following peace of code just above it.

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
function PopIt() { return &quot;Are you sure you want to leave?&quot;; }
function UnPopIt() { /* nothing to return */ }

$(document).ready(function() {
window.onbeforeunload = PopIt;
$(&quot;a&quot;).click(function(){ window.onbeforeunload = UnPopIt; });
});
</script>

Replace Are you sure you want to leave? with your desired words.

3. Save the Template.

Not only the blogger users, but also anyone can use this script on their blogs/sites. Kindly wait till your site completes loading and then you will notice this stay on page exit popup once after you try to exit from the site. The live demo of this can be found on my blog, just try it out and just don't jump out :)


Drop your Questions and Comments Below.


Like This Article Please Take Five Seconds To Share It.



Get Free Daily Updates!

Subscribe us!



WANT TO BE ONE OF OUR GUEST AUTHOR ! We welcome our new authors who wants to share there articles with us. For more details (- CLICK HERE -)