Is there any way to access elements loaded inside an iframe?
I'm trying this but doesn't seem to work:
if($('#cboxLoadedContent iframe').contents().find('#customer-login')[0] ){ ... }
Is there any way to access elements loaded inside an iframe?
I'm trying this but doesn't seem to work:
if($('#cboxLoadedContent iframe').contents().find('#customer-login')[0] ){ ... }
If the content of the iframe is provided by another domain, the only way you can see its content from your page is that this content is given with appropriate CORS headers.
This is a protection scheme known as Same Origin Policy.
Note that there is also the solution to let the browser see only one domain, by using a proxy.
It worked, I hd opened the file locally (
file://
) whereas the content was loaded withhttp://
protocol.