![]() |
Delayed Exit Splash Javascript On one of my download page - Instead of a download link, I have set a redirection code for the download: Quote:
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: Quote:
Any ideas? |
Re: Delayed Exit Splash Javascript 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"> Then use this for the opening 'Body' tag... HTML Code: <body onload="setTimeout(function(){exitPopup()},5000);"> |
Re: Delayed Exit Splash Javascript 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. |
Re: Delayed Exit Splash Javascript Quote:
Quote:
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? |
Re: Delayed Exit Splash Javascript For some reason, the exit pop up code: Quote:
I have deleted the meta redirection code for testing, the exit code still pops up no matter what O_O.. |
Re: Delayed Exit Splash Javascript Bump, anyone please? need it urgent! |
Re: Delayed Exit Splash Javascript 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. |
Re: Delayed Exit Splash Javascript Oh ok, thank you so much for your help, and advises Brandon. This is why I love the community! :D |
Re: Delayed Exit Splash Javascript 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> |
| All times are GMT -6. The time now is 08:14 AM. |