0

I have the following code to insert a part of a website via an iframe on my webpage:

<iframe  scrolling="no" frameBorder="0"
  src="http://www.dn.se/" 
  style="width:100%; height:150px; border:none;">
</iframe>

I would like to open all links on the "iframed" website in my webpage's window (and not in the iframe). I have read on SO questions like this one, that I should use:

<base target="_parent" />

But I don't seem to get it right.

How can I open all links in a iframe window in it's parent's window, if it's a website I'm iframing?

(If possible I don't want to use a javascript library like jQuery.)

Community
  • 1
  • 1
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232

1 Answers1

0

If your website and the iFrame are not on the same domain name, the browser will not allow this.

It's called Cross-Site Scripting (XSS)

Deryck
  • 7,608
  • 2
  • 24
  • 43