SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    5
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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>

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,337
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    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.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Where the World Once Stood
    the blades of grass
    cut me still

  4. #4
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    5
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,337
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Vincent Puglia View Post
    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
    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.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  6. #6
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    5
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ParkinT View Post
    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?

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,833
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    5
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    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.?

  9. #9
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    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.

  10. #10
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    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.

  11. #11
    SitePoint Member
    Join Date
    Nov 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Quote Originally Posted by Pullo View Post
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •