Iframe resolution rejects error on local development: what are my options?

Here's what happens:

I have an application Ahosted on a.mycompany.comand an application Bhosted onb.mycompany.com

The application Acontains an iframe containing the page contained in the application B.

<!-- In A index.html: -->
<iframe src="http://b.mycompany.com/something.html" >

I need to either parent talk with iframe or iframe talk to parent.

It works fine when it is on the server, but when I develop locally, I have two different servers running on different ports, so I have to access them through:

http://a.mycompanydev.com:1234
http://b.mycompanydev.com:5678

And this leads to a security error because you cannot communicate using JS with an iframe from another domain / subdomain or using a different port.

What can I do?


: https://serverfault.com/questions/148171/how-to-map-localhost8080-to-simply-localhost

+3
2

id, , window.location.hash( URL #). . , Dojo, .

, postMessage.

+2

postMessage , , -, . - 80 , HTTP-. , 80, .

+2

Source: https://habr.com/ru/post/1748518/


All Articles