Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

How to show JavaScript message box before leaving current page?

Ads
banner
banner
banner
gamer Offline referral

Posts: 192
Joined: May 2013
Reputation: 4

#1
Member
I have been noticing many websites have an alert message box that popups when you are trying to leave the current page, I know it is done with JavaScript but as I have no idea about JavaScript coding I need your help?
maria Offline referral

Posts: 242
Joined: May 2013
Reputation: 4

#2
Member
I don't recommend using this cause it's quite annoying and not very user friendly, but if you need it then power to you Wink

Find you <body> tag and replace it with <body onbeforeunload="ExitPage();">
Find <head> tag and after it add this J
PHP Code:
<script type="text/JavaScript"
function 
ExitPage()
{
alert ('popup message');
getit()
}
function 
getit() {
askit confirm("popup message");
if (
askit == true)
alert('popup message');
else
if (
askit == false)
alert("popup message");
}
</script> 

Replace popup message with your text!





User(s) browsing this thread: 1 Guest(s)