0

I'm currently making an Iframe using javascript but when I try to access the iFrame using myIframe.contentWindow.document I receive the following error:

DOMException: Blocked a frame with origin "http://localhost:8082" from accessing a cross-origin frame.

Jelle den Burger
  • 1,428
  • 17
  • 31

1 Answers1

0

You cannot edit the contents of an iframe for security purposes. It seems like you might be trying to set content in the iframe since the cross-origin error is being thrown. You can copy the contents of the iframe to another object then edit it.

Things to consider if this is true...

Use AJAX via jQuery.. How to copy iframe content to div?

If using Chrome, understand that Chrome does not support local CORS... Deadly CORS when http://localhost is the origin

chromahoen
  • 21
  • 4