Forum Moderators: open

Message Too Old, No Replies

How to get iframe/javascript link to go to a redirect page?

         

dickbaker

4:33 pm on Aug 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a banner advertiser who recently gave me a new script for their banners. It's set up so that they can monitor results. In the past, though, their banner had a simple A HREF link which I could direct to an .asp page on my site that would update a field in the database so I could monitor clicks, and would then immediately redirect to the advertiser's page.

The new script uses Iframes and javascript, and I can't figure out a way to monitor the clicks. Here's the code, where example.com is the advertiser, and Mysite is my site:

<IFRAME SRC="http://ad.example.com/adi/N4371.Mysite/B2880954;sz=468x60;ord=[timestamp]?" WIDTH=468 HEIGHT=60 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'>
<SCRIPT language='JavaScript1.1' SRC="http://ad.example.com/adj/N4371.Mysite/B2880954;abr=!ie;sz=468x60;ord=[timestamp]?">
</SCRIPT>
<NOSCRIPT>
<A HREF="http://ad.example.com/jump/N4371.Mysite/B2880954;abr=!ie4;abr=!ie5;sz=468x60;ord=[timestamp]?">
<IMG SRC="http://ad.example.com/ad/N4371.Mysite/B2880954;abr=!ie4;abr=!ie5;sz=468x60;ord=[timestamp]?" BORDER=0 WIDTH=468 HEIGHT=60 ALT="Click Here"></A>
</NOSCRIPT>
</IFRAME>

adni18

7:16 am on Aug 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe you could put an invisible DIV over the ad, and when it is clicked, do your thing with the event and then tell the iframe.document.click() ? I have no idea if that'd work or not, you might just have to deal with not knowing, or maybe you could use an onUnload for the iframe, or you could ask your ad person to give you back the old code.

-adni

csuguy

10:09 am on Aug 19, 2008 (gmt 0)

10+ Year Member



I'm not sure if the invisible div would work - however if you used a div with a completely transparent image inside of it would. Use the images onclick attribute.