Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 7th Apr 2012, 06:23 AM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Hello warriors,

I always see sites that when you click them away you get a popup that asked you if you really want to leave and if you press no you go to a special offer. I really want this on my website but I have no idea what this script is so could anybody help me? please?
stephanreek is offline  
Unread 7th Apr 2012, 08:46 AM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Code:
<script language="javascript">
window.onbeforeunload = function() {return '1';}
</script>
phpg is offline  
The Following 2 Users Say Thank You to phpg For This Useful Post:
Unread 7th Apr 2012, 11:40 AM   #3
.. I am stiLL aLivE ..
 
WF99's Avatar
 
Join Date: 2012
Posts: 252
Thanks: 12
Thanked 23 Times in 23 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by phpg View Post

Code:
<script language="javascript">
window.onbeforeunload = function() {return '1';}
</script>

Thank you Mr. phpg .. Great script ..
WF99 is offline  
Unread 8th Apr 2012, 01:54 AM   #4
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Thank you this really helped me
stephanreek is offline  
Unread 8th Apr 2012, 02:45 AM   #5
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Do you also know how I can redirect them to another url when they click cancel? And how people who click on a link in the page or the buy now button don't get this popup?
stephanreek is offline  
Unread 8th Apr 2012, 06:27 AM   #6
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by stephanreek View Post

Do you also know how I can redirect them to another url when they click cancel? And how people who click on a link in the page or the buy now button don't get this popup?
Code:
<script language="javascript">
(function() {
    var __redirect_to = 'http://YOUR_REDIRECT_URL/';//put redirect URL here

    var _tags = ['button', 'input', 'a'], _els, _i, _i2;
    for(_i in _tags) {
        _els = document.getElementsByTagName(_tags[_i]);
        for(_i2 in _els) {
            if((_tags[_i] == 'input' && _els[_i2].type != 'button' && _els[_i2].type != 'submit') || _els[_i2].target == '_blank') continue;
            _els[_i2].onclick = function() {window.onbeforeunload = function(){};}
        }
   }

    window.onbeforeunload = function() {
        setTimeout(function() {
            window.onbeforeunload = function() {};
            setTimeout(function() {
                document.location.href = __redirect_to;
            }, 500);
        },5);
        return '1';
    }
})();
</script>
phpg is offline  
The Following 7 Users Say Thank You to phpg For This Useful Post:
Unread 8th Apr 2012, 08:05 AM   #7
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Thanks, I now have put this code on my website, and the popup does redirect to the other page but it also still gives the popup when somebody clicks on the order button or the links where they can order, does somebody know how to let that go away?

Code:
<script language="javascript">
(function() {
    var __redirect_to = 'http://internetmarketingebooks.eu/';//

    var _tags = ['button', 'input', 'a'], _els, _i, _i2;
    for(_i in _tags) {
        _els = document.getElementsByTagName(_tags[_i]);
        for(_i2 in _els) {
            if((_tags[_i] == 'input' && _els[_i2].type != 'button' && _els[_i2].type != 'submit') || _els[_i2].target == '_blank') continue;
            _els[_i2].onclick = function() {window.onbeforeunload = function(){};}
        }
   }

    window.onbeforeunload = function() {
        setTimeout(function() {
            window.onbeforeunload = function() {};
            setTimeout(function() {
                document.location.href = __redirect_to;
            }, 500);
        },5);
        return 'WAIT BEFORE YOU GO! CLICK THE *CANCEL* BUTTON RIGHT NOW! . I HAVE SOMETHING VERY SPECIAL FOR YOU COMPLETELY FREE.';
    }
})();
</script>
stephanreek is offline  
The Following User Says Thank You to stephanreek For This Useful Post:
Unread 8th Apr 2012, 08:26 AM   #8
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

If that doesn't work for you as is, then there is something on your page conflicting with this script, so you'd better tell exact url where you are going to put it.
phpg is offline  
Unread 8th Apr 2012, 09:07 AM   #9
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by phpg View Post

If that doesn't work for you as is, then there is something on your page conflicting with this script, so you'd better tell exact url where you are going to put it.
Marketing Ebooks - killer web copy this is the url
stephanreek is offline  
Unread 8th Apr 2012, 09:22 AM   #10
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

OK, try this, and place it near the end of your page, right before </body> or </html>

Code:
<script language="javascript">
(function() {
    setTimeout(function() {
    var __redirect_to = 'http://internetmarketingebooks.eu/';//

    var _tags = ['button', 'input', 'a'], _els, _i, _i2;
    for(_i in _tags) {
        _els = document.getElementsByTagName(_tags[_i]);
        for(_i2 in _els) {
            if((_tags[_i] == 'input' && _els[_i2].type != 'button' && _els[_i2].type != 'submit' && _els[_i2].type != 'image') || _els[_i2].target == '_blank') continue;
            _els[_i2].onclick = function() {window.onbeforeunload = function(){};}
        }
   }

    window.onbeforeunload = function() {
        setTimeout(function() {
            window.onbeforeunload = function() {};
            setTimeout(function() {
                document.location.href = __redirect_to;
            }, 500);
        },5);
        return 'WAIT BEFORE YOU GO! CLICK THE *CANCEL* BUTTON RIGHT NOW! PAGE. I HAVE SOMETHING VERY SPECIAL FOR YOU COMPLETELY FREE.';
    }
    }, 500);
})();
</script>
phpg is offline  
The Following 3 Users Say Thank You to phpg For This Useful Post:
Unread 8th Apr 2012, 12:10 PM   #11
HyperActive Warrior
War Room Member
 
Join Date: 2012
Posts: 161
Thanks: 46
Thanked 15 Times in 13 Posts
Blog Entries: 14
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Thanks it works
stephanreek is offline  
Unread 31st Aug 2012, 01:12 PM   #12
Warrior Member
 
Join Date: 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Is this script worth using? Won't it get blocked?
brockmar is offline  
Unread 31st Aug 2012, 11:31 PM   #13
Warrior Member
 
jsjohn96's Avatar
 
Join Date: 2012
Posts: 27
Thanks: 2
Thanked 5 Times in 3 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

You can learn more Javascript in W3Schools
jsjohn96 is offline  
Unread 10th Sep 2012, 12:13 PM   #14
Kevin Clanton
War Room Member
 
kevinclanton's Avatar
 
Join Date: 2012
Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

JS redirects can be blocked by some browsers (and/or some extensions). I think some versions of IE might have an issue with it (or might cause some issues in the future).. I know that the php script (exitredirect) is more or less useless if they are using IE..

I think the most effective way of presenting exit offers is displaying a hidden div, and hiding the original pages content, onBeforeUnload that is populated with your exit redirect URL. That way there is no navigation taking place...

One of the reasons for this, is that the user can see the exit offer (in most browsers) before even before clicking the confirm box (making the decision to stay or go). I found that I get a much higher success rate on my exit offers this way.

I actually have a wordpress plugin that i wrote that does this. i can put up as a WSO if you all are interested...

If you are interested Let me know

jQuery is also really effective for exit offers. And once the script is written it requires less knowledge of html to make it work...

If anyone wants any code samples of any of these, Let me know or PM me
kevinclanton is offline  
Unread 13th Nov 2012, 09:56 PM   #15
Minion Of Gozar
War Room Member
 
Ted Burkholder's Avatar
 
Join Date: 2010
Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Ok. Here is a exit popup script I found on "Another Forum"

Code:
<script type="text/javascript" language="javascript"> 
var areYouReallySure = false;
var internalLink = false;
function areYouSure() {
if (!areYouReallySure && !internalLink) {
areYouReallySure = true;
location.href="REDIRECT URL HERE"

return "*****************************************************nnWait! nnMaybe You're not Interested In My Report , But What About a Chance To Work With Me DIRECTLY? Remember, You're Simply Requesting Information. Also, You Will NEVER Get Spammed From Me!nnWhy Let This Chance Pass You By?nnOn The Next Page Enter Your Name, Email & Phone. I Will Call You PERSONALLY!  nnCLICK CANCEL TO TAKE THE SPECIAL OFFERnn*****************************************************";
}
}
window.onbeforeunload = areYouSure;
</script>
The thing is when someone tries to leave the page, everything works great. The PROBLEM is even when someone fills out the optin form on the page, the script sees the user as leaving & the popup opens. Any thoughts on avoiding this?
Ted Burkholder is offline  
Unread 14th Nov 2012, 02:02 PM   #16
Minion Of Gozar
War Room Member
 
Ted Burkholder's Avatar
 
Join Date: 2010
Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

How is this different than exitpop that Andy Fletcher gave away for free?
Ted Burkholder is offline  
Unread 14th Nov 2012, 02:35 PM   #17
Kevin Clanton
War Room Member
 
kevinclanton's Avatar
 
Join Date: 2012
Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Ted Burkholder View Post

How is this different than exitpop that Andy Fletcher gave away for free?
Not sure what you are talking about.. Do you mean in this thread or in another thread? I am not familiar with fletcher.

But i can say that I wrote this plugin and it is unique in that not only is it a very effective method of presenting multiple exit offers, you can modify the exit content based on time on page.. (IE if they bounce off the page they can see a different exit pop than if they are on the page for 5-10 minutes) which is pretty unique and different..
I am not aware of anyone else selling something like that
kevinclanton is offline  
Unread 14th Nov 2012, 02:37 PM   #18
Kevin Clanton
War Room Member
 
kevinclanton's Avatar
 
Join Date: 2012
Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Ted Burkholder View Post

Looking for a NON WordPress solution
Oh for a non wordpress solution you can use the script in this thread.
Or (if i remember correctly) if you look back through my posts, i have included some similar scripts as well. If i am wrong let me know and i will include one of my stand alone scripts...
kevinclanton is offline  
Unread 14th Nov 2012, 02:58 PM   #19
Minion Of Gozar
War Room Member
 
Ted Burkholder's Avatar
 
Join Date: 2010
Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

I'm just not sure why when someone opt's in, they still get the popup. Does this happen on your script also?
Ted Burkholder is offline  
Unread 14th Nov 2012, 03:01 PM   #20
Minion Of Gozar
War Room Member
 
Ted Burkholder's Avatar
 
Join Date: 2010
Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by kevinclanton View Post

Here is my WSO that is an exit pop plugin for wordpress,

http://www.warriorforum.com/warrior-...our-sales.html

It actually switches out the content on the page instead of bringing up a new window or having to load other content. If the user is on firefox they will actually see the content when they try and exit before clicking the confim (stay or leave) box.

In addition to being a solid exit pop plugin, it allows you to pick different pop pages based on the user's time on page.

Let me know if you have ny questions
would like to see a demo of that. Not the video demo, but an actual demo.
Ted Burkholder is offline  
Unread 14th Nov 2012, 03:35 PM   #21
Kevin Clanton
War Room Member
 
kevinclanton's Avatar
 
Join Date: 2012
Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Ted Burkholder View Post

I'm just not sure why when someone opt's in, they still get the popup. Does this happen on your script also?
Not on my pluggin, the pluggin automatically appends javascript to prevent the exit pop if a visitor follows a call to action.

Not sure if the script i copied to forum has that in it or not.. i certainly have a version of it somewhere...

Let me know if it doesn't, in the standalone script i wrote, the links have:
onClick="dontpop();"

and forms have onSubmit="dontpop();"

Then i have that function in the script which disables the pop.
kevinclanton is offline  
Unread 12th Nov 2013, 11:17 AM   #22
Internet Marketer
Registered Member
 
alamest's Avatar
 
Join Date: 2009
Location: London
Posts: 652
Thanks: 37
Thanked 71 Times in 65 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Do we have to upload in PHP file or HTML file... will it work in both one..

alamest is offline  
Unread 12th Nov 2013, 12:33 PM   #23
Graphics, PHP, .Net, Html
War Room Member
 
WebdevelopmentGroup's Avatar
 
Join Date: 2011
Location: New York, NY
Posts: 2,176
Thanks: 199
Thanked 170 Times in 132 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Theres a few WP plugins for POP UPS. Most PHP scripts are buggy with no direction.

Guillermo-

WebDevelopmentGroup NYC & CA- Small Business Web Development, App Development, WordPress Development, Graphic Designs, Online Marketing, Local Marketing & more!. "Call us 1.800.219.1314 or message us!". Visit us today! "Now On Live Chat Mon-Fri.". www.WebDevelopmentGroup.org
(Whitelable our Services)
===================================
==> #1 OFFLINE MARKETING FORUM ON THE WEB! <==
www.OFFLINEMARKETINGFORUM.com
(Register Now)
WebdevelopmentGroup is offline  
Unread 13th May 2014, 05:19 AM   #24
Warrior Member
 
Daisyonta's Avatar
 
Join Date: 2014
Posts: 7
Thanks: 0
Thanked 2 Times in 1 Post
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by stephanreek View Post

Hello warriors,

I always see sites that when you click them away you get a popup that asked you if you really want to leave and if you press no you go to a special offer. I really want this on my website but I have no idea what this script is so could anybody help me? please?
PHP Code:
function PopIt() 
{          return 
'Are you sure you want to leave?';     }     
function 
UnloadIt() 
{         
window.opener.nowDoThisOpener("pass this variable along too");     } 
     $(
document).ready(function() {         //set the function defining what should be done BEFORE unloading         window.onbeforeunload = PopIt;         //set the function defining what should be done ON unloading         window.onunload = UnloadIt;         //set all links to disable both of these on click         $('a').click(function()
{              window.onbeforeunload = null;             window.onunload=null;   
 });     }); 

Daisyonta is offline  
Unread 16th Feb 2016, 03:40 PM   #25
Warrior Member
 
Join Date: 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Originally Posted by phpg View Post

OK, try this, and place it near the end of your page, right before </body> or </html>

Code:
<script language="javascript">
(function() {
    setTimeout(function() {
    var __redirect_to = 'http://internetmarketingebooks.eu/';//

    var _tags = ['button', 'input', 'a'], _els, _i, _i2;
    for(_i in _tags) {
        _els = document.getElementsByTagName(_tags[_i]);
        for(_i2 in _els) {
            if((_tags[_i] == 'input' && _els[_i2].type != 'button' && _els[_i2].type != 'submit' && _els[_i2].type != 'image') || _els[_i2].target == '_blank') continue;
            _els[_i2].onclick = function() {window.onbeforeunload = function(){};}
        }
   }

    window.onbeforeunload = function() {
        setTimeout(function() {
            window.onbeforeunload = function() {};
            setTimeout(function() {
                document.location.href = __redirect_to;
            }, 500);
        },5);
        return 'WAIT BEFORE YOU GO! CLICK THE *CANCEL* BUTTON RIGHT NOW! PAGE. I HAVE SOMETHING VERY SPECIAL FOR YOU COMPLETELY FREE.';
    }
    }, 500);
})();
</script>
I tried this on my website and I'm still getting the exit pop-up when someone clicks the "buy" button. Am I missing something?
fitnick360 is offline  
Unread 29th Feb 2016, 04:02 PM   #26
Warrior Member
 
Join Date: 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

The script works great but I have the same problem with the order buttons. It will not pop when surfing between internal links but on the external order links it will pop open every 4th or 5th click even when I add onclick="exit=false" to the link or variations of that.
Anyone have any ideas how to stop the popup when clicking on order gifs?
Jagking is offline  
Unread 29th Feb 2016, 09:42 PM   #27
Warrior Member
 
Join Date: 2015
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

I also have the same questions as you. Thank you for answering

caubehntinhnghich is offline  
Unread 11th Mar 2016, 12:15 AM   #28
Warrior Member
 
Join Date: 2015
Location: Virginia
Posts: 23
Thanks: 2
Thanked 3 Times in 3 Posts
Default
Re: what is the script for an exit popup?
Share on: 
fb share twitter share gplus share more share

Hello Warriors,

In jQuery exit pop-up is:

<script type="text/javascript">

$(document).ready(function() {

$(document).mousemove(function(e) {

$('#exitpopup').css('left', (window.innerWidth/2 - $('#exitpopup').width()/2));
$('#exitpopup').css('top', (window.innerHeight/2 - $('#exitpopup').height()/2));

if(e.pageY <= 5)
{

// Show the exit popup
$('#exitpopup_bg').fadeIn();
$('#exitpopup').fadeIn();
}

});

$('#exitpopup_bg').click(function(){
$('#exitpopup_bg').fadeOut();
$('#exitpopup').slideUp();
});

});
</script>

<style type="text/css">

#exitpopup
{
text-align:center;
}

#exitpopup h1
{
margin-top:0px;
padding-top:0px;

}

#exitpopup p
{
text-align:left;
}

</style>



<div style="display: none; width:100%; height:100%; position:fixed; background:#000000; opacity: .8; filter:alpha(opacity=0.8); z-index:999998;" id="exitpopup_bg">

</div>
<div style="width:670px; height:450px; margin:0px auto; display:none; position:fixed; color:#ffffff; padding:20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; z-index:999999; background:rgb(20, 20, 20); background:rgba(0, 0, 0, 0.8);" id="exitpopup">
<h1>Wait!!! Before you go...</h1>
<p>Hello warriors this is the best answer for you<br /><br />

This is the best alternative for your question</p>
<a href="#"><img src="letmeinnow.png" style="width:568px; height:190px" border="0" style="border:0px; margin:0px auto;" /></a>

</div>
Jamesvictor is offline  
Closed Thread


Bookmarks

Tags
exit, popup, script


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:15 AM.