0

I am loading website (Site A) into my Iframe from my application(Site B). The loading site and my app hosted in different domain? I need to read content from Site A from my Site B. I have gone through so many links, but I can't find any solution from those links

Is there any way to set permission (Access-Control-Allow-Origin) in Site A for Site B to access? if not, any possible way?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
user985393
  • 83
  • 9
  • 2
    possible duplicate of [Cross domain iframe issue](http://stackoverflow.com/questions/9393532/cross-domain-iframe-issue) – Quentin Nov 26 '12 at 12:57

1 Answers1

1

There is no good way to do this, for security reasons. A couple of browsers have some hacky ways around it, but cross-browser compatibility becomes an issue.

If you have control over both domains you can use something like easyXDM to message back and forth.

http://www.webresourcesdepot.com/easyxdm-a-javascript-library-for-cross-domain-messaging/

If you don't have control of both domains you will not be able to accomplish what you are trying.

Ryan O'Neill
  • 1,710
  • 2
  • 13
  • 24