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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    120
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Refresh a webpage if user opens a link on that page in a new window/tab

    I hope I explain this right ... I have a webpage with ads like adsense ads. i.e. they are in a javascript that displays an iframe:

    e.g. <script src="http://myadvertiser.com/code.js"></script>

    the ads all open in a new window/tab when clicked. So, when the user clicks on an ad (in the iframe so outside of my "control"), can I make MY webpage refresh? i.e. when the user skips off to look at the advertiser's page, can my page refresh before they get back?

    I tried reading in to scripts detecting a mouse being detected on the page, but that wouldn't include touch devices.

    Anyone any ideas where to start looking on this one? Or would I just have to go for mousedetection and ignore trying to do this with touch devices?

    Thanks
    Mike
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,447
    Thanks
    76
    Thanked 4,372 Times in 4,337 Posts
    Using onClick over an iframed area?

    What was wrong with the answer in that thread?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Apr 2010
    Posts
    120
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Sorry, double post! I thought I'd asked that question on another forum first ...
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,990
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    @instaunt -

    If you post in multiple forums you will find that you may not get an answer in any of them. People do not want to waste time answering a question when it has perhaps already been answered elsewhere.

    There are few things in forums more irritating than taking the time to unsnarl someone's markup, javascript and css, figure out the fix, and post it only to find you've wasted your time because a duplicate post in another forum has already been answered.

    In short, please do not post the same question in multiple forums until several days have elapsed without getting an answer.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Regular Coder
    Join Date
    Apr 2010
    Posts
    120
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I fully understand. Whilst not a most active member in this forum yet, I am a 1000s plus poster in others so know how frustrating it can be.

    This wasn't deliberate or "gross" negligence though, whilst the end goal of this question and the other may seem the same, they arose from different ideas. i.e. because people were saying I couldn't affect clicks over an iframe, I wondered whether I could affect the page simply because the user had opened a new window/tab.

    This question was deeply related to the first though, I admit.
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!


  •  

    Posting Permissions

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