views:

146

answers:

3

I have an iframe that displays a flash banner ad which has clickable links. Is there anyway to force the links to open in parent window, without putting JS on the page that opens or changing the flash file?

For example, is there something i can do to the iFrame to force links to open in its parent?

A: 

If the links were HTML, yes. But since the links are embedded in the SWF itself, there is no way to change their targt, AFAIK.

x0n
A: 

No, you absolutely cannot do this. You ad is likely served from a domain different than the rest of the page outside of the iframe. The only security restriction applied to JavaScript is called same origin execution. A browser will not execute any JavaScript that originates in a domain different than that of the effect page/window. As a result JavaScript is not your answer.

A: 

This little snippet should do it:

   if (top.location != location) {
     top.location.href = document.location.href ;
   }
CodeJoust