Iframe is on test.com and throws a request to ca.test.com
I want to access the content:
iframe = $('#deposit') iframe.contents() Mistake:
Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin " https://www.test.com " from accessing a cross-origin frame. (...)
Nginx settings:
server { server_name test.com; add_header Access-Control-Allow-Origin ca.test.com; # < this is the needed header # rest of the configuration } Where is the mistake?