| | #1 |
| HyperActive Warrior War Room Member |
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? |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2004 Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
| Code: <script language="javascript">
window.onbeforeunload = function() {return '1';}
</script> |
| |
| The Following 2 Users Say Thank You to phpg For This Useful Post: |
| | #3 |
| .. I am stiLL aLivE .. Join Date: 2012
Posts: 252
Thanks: 12
Thanked 23 Times in 23 Posts
| |
| |
| | #5 |
| HyperActive Warrior War Room Member |
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?
|
| |
| | #6 | |
| HyperActive Warrior War Room Member Join Date: 2004 Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
|
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> | |
| |
| The Following 7 Users Say Thank You to phpg For This Useful Post: |
| | #7 |
| HyperActive Warrior War Room Member |
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> |
| |
| The Following User Says Thank You to stephanreek For This Useful Post: |
| | #8 |
| HyperActive Warrior War Room Member Join Date: 2004 Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
|
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.
|
| |
| | #9 | |
| HyperActive Warrior War Room Member |
| |
| |
| | #10 |
| HyperActive Warrior War Room Member Join Date: 2004 Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
|
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> |
| |
| The Following 3 Users Say Thank You to phpg For This Useful Post: |
| | #12 |
| Warrior Member Join Date: 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
Is this script worth using? Won't it get blocked?
|
| |
| | #13 |
| Warrior Member Join Date: 2012
Posts: 27
Thanks: 2
Thanked 5 Times in 3 Posts
|
You can learn more Javascript in W3Schools
|
| |
| | #14 |
| Kevin Clanton War Room Member Join Date: 2012 Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
|
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 |
| |
| | #15 |
| Minion Of Gozar War Room Member Join Date: 2010 Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
|
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> |
| |
| | #16 |
| Minion Of Gozar War Room Member Join Date: 2010 Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
|
How is this different than exitpop that Andy Fletcher gave away for free?
|
| |
| | #17 | |
| Kevin Clanton War Room Member Join Date: 2012 Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
|
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 | |
| |
| | #18 |
| Kevin Clanton War Room Member Join Date: 2012 Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
|
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... |
| |
| | #19 |
| Minion Of Gozar War Room Member Join Date: 2010 Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
|
I'm just not sure why when someone opt's in, they still get the popup. Does this happen on your script also?
|
| |
| | #20 | |
| Minion Of Gozar War Room Member Join Date: 2010 Location: Pittsburgh, PA
Posts: 57
Thanks: 14
Thanked 42 Times in 27 Posts
|
| |
| |
| | #21 | |
| Kevin Clanton War Room Member Join Date: 2012 Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
|
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. | |
| |
| | #22 |
| Internet Marketer Registered Member Join Date: 2009 Location: London
Posts: 652
Thanks: 37
Thanked 71 Times in 65 Posts
|
Do we have to upload in PHP file or HTML file... will it work in both one..
|
| | |
| |
| | #23 |
| Graphics, PHP, .Net, Html War Room Member Join Date: 2011 Location: New York, NY
Posts: 2,176
Thanks: 199
Thanked 170 Times in 132 Posts
|
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) | |
| |
| | #24 | |
| Warrior Member Join Date: 2014
Posts: 7
Thanks: 0
Thanked 2 Times in 1 Post
|
PHP Code: | |
| | ||
| |
| | #25 | |
| Warrior Member Join Date: 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
| |
| |
| | #26 |
| Warrior Member Join Date: 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
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? |
| |
| | #27 |
| Warrior Member Join Date: 2015
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
I also have the same questions as you. Thank you for answering |
| | |
| |
| | #28 |
| Warrior Member Join Date: 2015 Location: Virginia
Posts: 23
Thanks: 2
Thanked 3 Times in 3 Posts
|
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> |
| |
|
| Bookmarks |
| Tags |
| exit, popup, script |
| |