papa_face
papa_face

Reputation: 31

Force iframe (on different domain) links to open in a new window

Contained within my web page is an iframe that's src is set to load a page from another domain. This domain has links with target="_top".

What I'm trying to achieve is, when someone clicks one of these links, I'd like it to open in a new window rather than load in the current window.

Is there any way to "catch" this and do what I require?

Thanks!

Upvotes: 0

Views: 1094

Answers (1)

Mouser
Mouser

Reputation: 13304

The domain has probably very good reasons to put target="_top" in their links. They don't want to be ran inside a(n) (i)frame. The correct answer to this is "No, this can't be done." Obvious security reasons prohibit us to do this.

You don't want somebody messing with your page by running it in an iframe. Phising and password retrieval becomes kind of easy when this is allowed. Browsers will not allow this these days.

Upvotes: 1

Related Questions