Forum Moderators: open
So I've got an iframe in a page that pulls a url from an affiliate company i work with. Unfortunately that means I can't change their code, as I don't have access to. I can just open their iframe.
The links in the iframe keep opening new windows when clicked on, and I'd like to keep them in the iframe.
Is there a javascript solution for this? I'm thinking do something with the iframe like onLoad, grab the href's of the links in the iframe and add some code that will say to open links in the current window of the iframe.
I can't seem to find anything in google about this, but I think it's possible. If anyone can point me in the right direction, it'd be greatly appreciated!
If the IFRAME is on a different domain you can't access anything in it with JS. The only way would be to add some code into their site so you could sent commands via the URL, but you can't.
If the IFRAME was on the same domain you could use an onLoad on the IFRAME and search the IFRAME's DOM to change the links.
Sorry.