0

I'm using iframe to open a website in html. However, many target attributes are _blank and _top in the website.

Therefore, the pages always open in a new window.

How to force the link open in same inframe in html?

My code below:

<iframe name="inapp" frameborder="0" src="http://www.w3schools.com" target="_self"></iframe>
Rob
  • 14,746
  • 28
  • 47
  • 65

1 Answers1

2

I'm afraid you can't if you are embedding a page from another website. There's strict cross-domain security measures in browser to prevent your page from accessing the contents of the iFrame. If you have control over the underlying page, then that's different, but I guess you wouldn't have the target issue in the first place.

raphv
  • 1,153
  • 7
  • 10