Tuesday, 26 May 2015

Stay on Page or Leave this page exit popup

tips4tricx
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
Previous Post
Next Post

post written by:

0 Google+:

Please Keep in mind that if there is a link in your comment section it will be considered as spam. Comment with link will be removed instantly.
Comment to get answered or to solve a problem not to spam. Thanks