Reputation: 179
How do I add a link to external iframe?
<iframe id='abcdef' name='abcdef' src='http://externaldomain.com?id=99' framespacing='0' frameborder='no' scrolling='no' width='960' height='60'>
<a href='http://anotherexternaldomain.com' target='_blank'>
<img src='http://externaldomain.com?pic=99' border='0' alt='' />
</a>
</iframe>
This is external ads which is put inside my website. I want to add a link to this iframe in order to track the impression and number of click
Is there any way to use with jQuery perhaps? Thank you!
Upvotes: 3
Views: 11663
Reputation: 179
Anyway i've thought a way to add link. I'm using an overlay div with absolute position to cover the iframe entirely so the iframe is behind the div. Thanks anyone who has helped me :)
Upvotes: 2
Reputation: 324600
You can't.
The iframe
's content is whatever its src
tells it. You might be able to proxy the ad and track the clicks, but usually ad providers will track clicks for you.
Side-note:
with jQuery perhaps?
There is nothing jQuery can do that cannot be done in plain JavaScript. If JS can't do it, neither can jQuery.
Upvotes: 2