3

This is for when the page containing the iframe is on a different domain.

For example, when loading this page in an iframe ( http://bleacherreport.com/articles/1707335-5-green-bay-packer-players-who-will-surprise-in-training-camp ), the slideshow buttons will no longer work and comments will not show because the JS won't load. I've seen sites like StumbleUpon get around issues like this. How can this be achieved?

Tony Paternite
  • 153
  • 1
  • 14
  • 1
    Normally, a page can just load it's own javascript, also if it is loaded in an iframe. This will not work when the javascript is hosted on a different domain, but I think that applies to normal pages as well, not just those in a frame. – GolezTrol Jul 22 '13 at 19:08
  • Try this method and see if it works: http://stackoverflow.com/a/17262334/888177 – Stefan Jul 22 '13 at 19:15

1 Answers1

1

I ended up finding a simple solution.

Add allow-same-origin to the sandbox attribute of the iframe tag.

I have no idea why this works because they are different origins, but this allows the slideshow and comments to show up on bleacherreport, yahoo, and many other articles where it wouldn't before.

Tony Paternite
  • 153
  • 1
  • 14