Uncaught SecurityError: Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:9529" from accessing a cross-origin frame.

分类:Javascript| 发布:camnpr| 查看: | 发表时间:2024/1/13

 Uncaught SecurityError: Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:9529" from accessing a cross-origin frame.

    at ./src/main.js (main.js:127:23)

    at __webpack_require__ ((索引):99:30)

    at 0 (templateLabelConfig.vue:1:1)

    at __webpack_require__ ((索引):99:30)

    at checkDeferredModules ((索引):65:23)

    at Array.webpackJsonpCallback [as push] ((索引):52:19)

    at app.1736758244600.js:1:57

解决方案:

//主页面 向 iframe传递事件//主页面

var frame = document.getElementById('iframeId');frame.contentWindow.postMessage(object,'*');

//iframe页面iframe: window.addEventListener('message',function(event){ //此处执行事件})
//iframe向主页面传递事件

//iframe页面window.parent.postMessage(object,'*');//主页面window.addEventListener('message',,function(event){ //此处执行事件})
原创文章如转载,请注明:转载自郑州网建-前端开发 http://camnpr.com/
本文链接:http://camnpr.com/javascript/2297.html