Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pop Under Script

    Hi everyone:

    I need help taking this pop under script:

    <script language="JavaScript">
    var popunder="URL GOES HERE"
    function loadpopunder(){
    win2=window.open(popunder)
    win2.blur()
    window.focus()
    }
    loadpopunder()
    </script>

    and making it so that I can set it so it only pops up one time and then will not pop up again until after a certain time period. Also, is there a way to make it so it can avoid pop up blockers?

    Thank you!

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by bsl1964 View Post
    Hi everyone:

    I need help taking this pop under script:

    <script language="JavaScript">
    var popunder="URL GOES HERE"
    function loadpopunder(){
    win2=window.open(popunder)
    win2.blur()
    window.focus()
    }
    loadpopunder()
    </script>

    and making it so that I can set it so it only pops up one time and then will not pop up again until after a certain time period. Also, is there a way to make it so it can avoid pop up blockers?

    Thank you!
    If the "certain time period" extends beyond a browser session then you will need a cookie. Cookies have been covered very extensively in this forum.

    No, if it was possible to circumvent pop-up blockers then the pop-up blockers would be useless, no? Thankfully all modern browsers block unrequested pop-ups. You can detect that your code is very old - <script language="JavaScript"> is long obsolete and deprecated.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your feedback. Do you have a more up to date code that will do what I want?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    As I say, all modern browsers will block unrequested pop-ups/pop-unders. The code is old because it was written in the days before that applied. It is of no use today. So you need to re-think your idea. You can of course have a pop-up which appears when requested by the user.


  •  

    Posting Permissions

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