1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need Help Please !

Discussion in 'PHP & Perl' started by kelvinator44, Jun 23, 2010.

  1. kelvinator44

    kelvinator44 Newbie

    Joined:
    Jun 11, 2009
    Messages:
    24
    Likes Received:
    2
    Well I have created a script that creates an invisible div layer that follows the mouse cursor and when a user clicks on it he clicks an ad. Now the only problem I have is that I want the page to reload when the user clicks the div. Any ideas or suggestions are welcome.
     
  2. vis3r

    vis3r Registered Member

    Joined:
    Jul 25, 2008
    Messages:
    62
    Likes Received:
    30
    You'd need to get to the click event from that div, so you'd know when to reload the page.. but the problem I see is that since you have an ad in there, which is in an iframe, I'm not sure you can catch the click event of an iframe... cause iframes have a pretty limited access
     
  3. kelvinator44

    kelvinator44 Newbie

    Joined:
    Jun 11, 2009
    Messages:
    24
    Likes Received:
    2
    @vis3r Thanks for your quick reply.Yeah I thought the same but I was thinking isnt there anyway to traverse though the a href tags in the iframe and update their onclick event to a function that reloads the page
     
  4. _Chip_

    _Chip_ Senior Member

    Joined:
    Jun 28, 2009
    Messages:
    847
    Likes Received:
    256
    Occupation:
    Student
    Location:
    Depends on my vpn
    yes ... i dont think its possible in an iframe !
     
  5. kelvinator44

    kelvinator44 Newbie

    Joined:
    Jun 11, 2009
    Messages:
    24
    Likes Received:
    2
    What abt getElementsByTagName('a') and then changing their onclick to reload the page ?
     
  6. kelvinator44

    kelvinator44 Newbie

    Joined:
    Jun 11, 2009
    Messages:
    24
    Likes Received:
    2
    Nevermind guys figured it out. Quite simple solution when you think abt it :p