raadmunir — 2013-11-26T05:43:48-05:00 — #1
I am looking for a onclick popunder, and i got a script, it works like what i am looking for, problem is it open's popunder once 24HRs on same browser, i want to set some cookies that it will open after X hours or minutes.
parkint — 2013-11-26T08:09:57-05:00 — #2
Welcome to the forums, @raadmunir;
Although you obviously have an immediate need for some assistance, please take full advantage of the volumes of information that already exists here in order to learn more about Web Development.
vincent_puglia — 2013-11-26T09:30:04-05:00 — #3
Let me get this straight. You want to open a window, under the current window 24 hours later (or at some date & time you set in the cookie...
raadmunir — 2013-11-26T11:05:12-05:00 — #4
well may be i was unable to express completely, what i want, as i said current script open's popunder once in 24hrs per user. i want that where ever user click on my site anywhere or when ever anyone visit my site, popunder should be open.
Sorry for my bad English.
parkint — 2013-11-27T08:30:39-05:00 — #5
I believe the intention is to open a window but only if it has not been opened within the past 24 hours. In other words, using a cookie to determine if/when the popunder was last opened.
raadmunir — 2013-11-27T13:16:44-05:00 — #6
Yes You are right. Any solution?
felgall — 2013-11-27T13:19:24-05:00 — #7
Save a cookie that expires in 24 hours when you open the window.
Before opening the window check if the cookie exists and if so don't open the window.
raadmunir — 2013-11-27T13:22:38-05:00 — #8
Thanks for your reply. i am not a coder, please can you modify above code or can provide like that.?
pullo — 2013-11-27T14:06:43-05:00 — #9
This page provides a good explanation of how cookies work and provides sample code for you to use on your website.
Alternatively, if you are using jQuery, then there is a cookie plugin which simplifies the syntax a little and is equally as well documented.
Why don't you choose one of those, read the documentation and try to implement it with the code you have.
If you get stuck you can post back here for help.
pullo — 2013-11-27T14:10:58-05:00 — #10
BTW, if you look at the site you link to, the code to open a popunder looks quite nefarious.
Anyone seen anything like this before?
I did, and it was whilst watching a video of some guy analyse some JS found embedded in a PDF.
The JS looked rather like the above and was (if I remember correctly) capable of downloading an executing malicious code on the user's machine.
thecodemaster — 2013-11-27T15:05:18-05:00 — #11
Looks more like they are trying to copyright protect their code by encrypting it. Common practice if you don't want your hard work copied.