PDA

View Full Version : JavaScript on links in iframes


eoincunningham
09-17-2002, 05:26 PM
Hi,
I'm looking for some help with Iframes please.
Does anybody know how to make the link in an iframe "take over" the parent window when clicked? IE: When you click on the link in the page inside the iframe, the window containing the page with the iframe in it is the one which goes to that link, as opposed to the link opening inside the iframe.

Here's my main problem. I already know how to do this, but in order to call my javascript function when the link is clicked, I can only place the function call in the anchor for the link. Unfortunately, the pages inside the iframes are on another site, and therefore I obviously have no control over how they are written and can't place my function calls there. So all my code needs to be on the page which contains the iframes.

beetle
09-17-2002, 08:11 PM
IFRAME security for pages outisde of the current domain will most likely thwart any efforts you make at achieving this.

Sorry.

eoincunningham
09-17-2002, 10:27 PM
Damn. Thanks.

MAXIMUS
09-18-2002, 07:25 PM
I don't see why you just couldn't set the target of your link inside the iframe html document...

<a href="test.html" target="_parent">test</a>

eoincunningham
09-18-2002, 08:23 PM
I have no control over the HTML code for the pages inside the iframes (they're eBay pages, to be specific) and therefore can't take any of the traditional approaches to this problem.