2 Replies - 1580 Views - Last Post: 18 March 2013 - 10:18 AM

#1 irab88  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 28-July 08

Not Your Typical iFrame Linking Problem

Posted 18 March 2013 - 08:58 AM

yes, i know to use name="iframename" and the corresponding target="iframename"

but this has me going crazy:

<!DOCTYPE html>
<html>
<body>

<iframe src="demo_iframe.htm" name="goppm"></iframe>

<a href="http://www.yahoo.com" target="goppm">Yahoo</a>
<br>
<iframe src="demo_iframe.htm" name="iframe_a"></iframe>

<a href="http://www.w3schools.com" target="iframe_a">W3Schools.com</a>

</body>
</html>


the first part (goppm/yahoo.com) doesn't work at all.
the second part (iframe_a/w3schools.com) works perfectly.

it's a crap-shoot of which url's work and don't work. is there a reason, or should i just accept it?

(btw- i've tried this both in the w3 "try-it editor" and with an html file. same results)

Is This A Good Question/Topic? 0
  • +

Replies To: Not Your Typical iFrame Linking Problem

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,867
  • Joined: 12-December 12

Re: Not Your Typical iFrame Linking Problem

Posted 18 March 2013 - 10:04 AM

You have a same-origin policy issue. Error message from Chromes' Console:

Quote

Refused to display 'http://uk.yahoo.com/?p=us' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Learn to use your Console, there are links in my signature.

This post has been edited by andrewsw: 18 March 2013 - 10:04 AM

Was This Post Helpful? 1
  • +
  • -

#3 irab88  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 28-July 08

Re: Not Your Typical iFrame Linking Problem

Posted 18 March 2013 - 10:18 AM

thanks. i got everything working now. plus one to you, my good sir!

future reference: a quick search on same-origin policy explained everything i needed to know. i didn't know about it before, so i didn't know what to search for.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1