0

If I understand things good, iframe can be used to embed external sites withing my page, that includes also AJAX sites. For the site the iframe is quite transparent.

I have external site, made with Ext 2.3.0. However, when I try to load this site within iframe, I have the following errors:

Error: Permission denied to access property 'cwc'

cwc-Extjs-All.js (Zeile 2).

Error copied from Firebug, but under IE 9 it doesn't work as well.

I have no possibility to change the external site. What can I do on my site to make that site work?

--edit--

My first guess was that it has something to do with Same Origin Policy, but other AJAX sites are working correctly, so it may be general Ext problem with iframes.

Community
  • 1
  • 1
Danubian Sailor
  • 1
  • 38
  • 145
  • 223

1 Answers1

0

There is a same domain policy for iframes, like for XHR. You can load any site you want in the iframe (provided the site doesn't explicitly forbid it), but the browser will let you access the content of the iframe only if it has been loaded from the same origin (i.e. same domain, same port) as the main page. If that is not the case, you won't be able to access the iframe content, let alone modify it.

If you need to interact with the iframe and cannot load it from the same domain, you can proxy the external site from your server:

client <=> proxy script (on same domain) <=> external application

Different solutions are also suggested in this post.

Community
  • 1
  • 1
rixo
  • 23,815
  • 4
  • 63
  • 68