Uncaught DOMException: Blocked a frame with origin "http://127.0.0.1" from accessing a cross-origin

我浏览自己tomcat上网页用的localhost,访问的子页面用的127.0.0.1,

所以只要浏览器中的localhost改为127.0.0.1就好了

下面是别人出现的类似错误,敲黑板,做笔记。

博客内容来自http://www.zhimengzhe.com/HTMLjiaocheng/151489.html

iframe子页面调用父页面方法 跨域 异常 Blocked a frame with origin

Blocked a frame with origin "http://127.0.0.1:8080" from accessing a frame with origin "http://localhost:8080".Protocols, domains, and ports must match.

这个是因为你的父页面和子页面不在同一个域下做成的。如这里父页面是在http://localhost:8080,而子页面在http://127.0.0.1:8080下,更改一下路径就可以了。

 

以上就是iframe子页面调用父页面方法 跨域 异常 Blocked a frame with origin的全文介绍,希望对您学习和使用html网页基础有所帮助.

你可能感兴趣的:(Uncaught DOMException: Blocked a frame with origin "http://127.0.0.1" from accessing a cross-origin)