| | #1 | ||
| edmicah.com War Room Member Join Date: 2011 Location: Southside
Posts: 538
Thanks: 79
Thanked 175 Times in 75 Posts
|
On one of my download page - Instead of a download link, I have set a redirection code for the download:
The problem is that, I also have the exit popup - exitsplash codes installed on that page. Therefore when the download redirect executes, the exit popup pops up.... And this is not what I want. So I was thinking if it's possible to delay the exit popup script to like 3seconds/5seconds, so that it runs the script after the user has downloaded the file already? I have found this solution:
Any ideas? | ||
| |
| | #2 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
If that is all of the Javascript code for the exit popup, then you are missing a few things. Try this instead: Put this in the <head> section... HTML Code: <meta http-equiv="refresh" content="0;url=http://www.YourZipFile.zip"> <script type="text/javascript"> <!-- function exitPopup() { var answer = confirm("*************** BEFORE YOU GO! *************** nn Click the 'OK' button for something very special! nn Or click the 'Cancel' button if you're not interested."); if (answer){ /* If OK button was clicked */ window.location = "http://www.SpecialOfferPage.com"; } } //--> </script> Then use this for the opening 'Body' tag... HTML Code: <body onload="setTimeout(function(){exitPopup()},5000);"> |
| | |
| |
| | #3 |
| Kevin Clanton War Room Member Join Date: 2012 Location: Austin, Tx
Posts: 54
Thanks: 5
Thanked 10 Times in 10 Posts
|
Good call Ed. Also stop using exitSplash, that script didn't work very well with IE (unless there was an update i am unaware of) I am also a big fan of displaying a hidden div (and hiding what ever content was on the page) in leu of a redirect. |
| |
| | #4 | ||
| edmicah.com War Room Member Join Date: 2011 Location: Southside
Posts: 538
Thanks: 79
Thanked 175 Times in 75 Posts
|
Yes, it was missing a line of code which was the line that calls the exitsplash.php But I think I will try yours after this, since Kevin has mentioned that Exitsplash doesn't work properly on IEs.... And one thing I don't really understand is that, what do you mean by " But the exact timing won't be very important, because the 'download file' popup will hide the exit popup at first."?? I thought the purpose was to execute the exit popup script after the meta redirect has executed? | ||
| |
| | #5 | |
| edmicah.com War Room Member Join Date: 2011 Location: Southside
Posts: 538
Thanks: 79
Thanked 175 Times in 75 Posts
|
For some reason, the exit pop up code:
I have deleted the meta redirection code for testing, the exit code still pops up no matter what O_O.. | |
| |
| | #6 |
| edmicah.com War Room Member Join Date: 2011 Location: Southside
Posts: 538
Thanks: 79
Thanked 175 Times in 75 Posts
|
Bump, anyone please? need it urgent!
|
| |
| | #7 |
| Advanced Warrior War Room Member Join Date: 2006 Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
|
Ed, I thought you wanted the popup to appear after the user has been on the page for X seconds, which is exactly what the code I provided does. If you want the popup to appear when the user tries to leave the page, on the other hand, then you can make a popup appear then... BUT if you do it that way (example here), then you will not be able to redirect them to a different URL (the only options would be 'leave site' or 'stay on current page'). As far as I know, there is no way around this, as it's a security feature on all modern browsers. So your options are to use a time-based popup, which gives you the ability to redirect to a different URL. Or you can use a popup that detects when the user is trying to leave, but you will not have the ability to redirect them to a different URL in that case. |
| | |
| |
| | #8 |
| edmicah.com War Room Member Join Date: 2011 Location: Southside
Posts: 538
Thanks: 79
Thanked 175 Times in 75 Posts
|
Oh ok, thank you so much for your help, and advises Brandon. This is why I love the community! |
| |
| | #9 |
| HyperActive Warrior War Room Member Join Date: 2011 Location: Spain
Posts: 318
Thanks: 40
Thanked 28 Times in 28 Posts
|
I am using this one on my wordpress inside the post and its working for me. I use it with my squeeze pages. Please change this howto.harrybhanot.com/localsniperjv/ with your site. <SCRIPT LANGUAGE="JavaScript"> var cookie="qspVF8JC"; var exit=true; var filename='http://howto.harrybhanot.com/localsniperjv/'; var popup; var height="+screen.height+"; var width="+screen.width+"; var left=(screen.width/2)-("+screen.width+"/2); var top=(screen.height/2)-("+screen.height+"/2); function exitpop(){ if(exit){ if (getcookie(cookie)==""){ popup = window.open(filename, "","height="+height+",width="+width+",top="+top+", left="+left+",location=yes,menubar=yes,resizable=y es,scrollbars=yes,status=yes,titlebar=yes,toolbar= yes,directories=yes"); setcookie(); } } } function getcookie(cookieName) { var id = cookieName + "="; var cookievalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(id); if (offset != -1) { cookievalue = "x"; } } return cookievalue; } function setcookie () { var today = new Date(); var expdate = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000); document.cookie = cookie + "=" + escape ("done")+ ";expires=" + expdate.toGMTString(); } document.onunload=exitpop; window.onunload=exitpop; </SCRIPT> |
| | |
| |
|
| Bookmarks |
| Tags |
| delayed, exit, javascript, splash |
| Thread Tools | Search this Thread |
| |