|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi!
I need to find a way to open up a new window when ever a user clicks on a link in a iframe that I do not control. The contents of the frame are advertising banners for flycast - some are rich media. I do NOT have access to the contents of the iframe. As a result, I do not have access to the <A HREF...> code in the iframe either. Is there any way that can be done? (i.e. with Onclick?) Please be through when posting any sample code as I am a complete Javascript newbie (I always use php - but this time flycast has chosen javascript) Here is the flycast banner code: FlycastLoaded = true; FlycastRandom = 0; FlycastFoundMSIE = navigator.userAgent.indexOf("MSIE") >= 0; FlycastFoundMSIE2 = navigator.userAgent.indexOf("MSIE2") >= 0 | | navigator.userAgent.indexOf("MSIE 2") >= 0; FlycastFoundMSIE3 = navigator.userAgent.indexOf("MSIE 3") >= 0; FlycastFoundNN = navigator.userAgent.indexOf("Mozilla/") >= 0 && !FlycastFoundMSIE; FlycastFoundNN2 = navigator.userAgent.indexOf("Mozilla/2.") >= 0 && !FlycastFoundMSIE; FlycastFoundNN3 = navigator.userAgent.indexOf("Mozilla/3.") >= 0 && !FlycastFoundMSIE; function FlycastDeliverAd () { FlycastAdServer = "http://adex3.flycast.com/server"; if (FlycastNewAd) { FlycastNow = new Date(); FlycastRandom = FlycastNow.getTime(); FlycastRandom = FlycastRandom % 10000000; if (!(FlycastFoundNN2 | | FlycastFoundMSIE3)) FlycastRandom += Math.floor(Math.random() * 100); } FlycastSiteInfo = FlycastSite + "/" + FlycastPage + "/" + FlycastRandom; if (FlycastFoundMSIE2) { document.write('<A HREF="' + FlycastAdServer + '/click/' + FlycastSiteInfo + '"><IMG SRC="' + FlycastAdServer + '/ad/' + FlycastSiteInfo + '" scrolling="no" marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0 width=' + FlycastWidth + ' height=' + FlycastHeight + '></A>'); } else if (FlycastFoundMSIE) { document.write('<IFRAME SRC="' + FlycastAdServer + '/iframe/' + FlycastSiteInfo + '" scrolling="no" marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0 width=' + FlycastWidth + ' height=' + FlycastHeight + '></IFRAME>'); } else { document.write('<S' + 'CRIPT SRC="' + FlycastAdServer + '/js/' + FlycastSiteInfo + '" LANGUAGE=JAVASCRIPT></SCRIPT>'); } } if (FlycastFoundNN3 && FlycastPrintTag) { FlycastLoaded = false; FlycastDeliverAd(); } Sorry if the code got messed up in the posting... Thanks!!! |
|
#2
|
|||
|
|||
|
If you do not have access to the source to change it it is not possible to control with JavaScript what happens when someone clicks on an area on another page.
This is not possible because of obvious security issues. ------------------ Ramon Litjens Boradoli Web Design (www.boradoli.nl) |
|
#3
|
|||
|
|||
|
In IE5 you should be able to put an onClick="return dosomethinghere()" statement in the IFRAME tag that you include in your page that contains the ad..
Since it looks like the IFRAME is being generated by the Javascript, you would have to edit their script code, which might be against your terms of service with Flycast.. You could also enclose the whole mess in a <DIV> and put an onclick statement in your DIV.. With even bubbling, even if they click on something inside the DIV, the event will bubble back up to the DIV eventually.. hope this helps.. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Help with opening a new window in a frame that I do not control |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|