Onclick popunder

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.

<script type=“text/javascript” src=“http://beaverscripts.com/openwindow.js?puurl=http://google.com”></script>

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.

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…

not nice :frowning:

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.

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.

Yes You are right. Any solution?

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.

Thanks for your reply. i am not a coder, please can you modify above code or can provide like that.?

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.

BTW, if you look at the site you link to, the code to open a popunder looks quite nefarious.
http://beaverscripts.com/openwindow.js

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.

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.