javascript - 如何从不同的域访问 Javascript 到本地服务器
问题描述
我遇到了无法将控制权恢复到本地机器的问题。
我已经加载了 iframe,在 iframe 中完成我的旅程后,我想单击我的应用程序 JS,但出现错误:
Monthly.js:5 Uncaught DOMException: Blocked a frame with origin " http://xx.xxx.xx.xx " 访问跨域框架。在 window.onload ( http://xx.xx.xx.xxx/something/Monthly.js:5:20 )
我试图谷歌很多东西,但无法解决这个问题。
我在加载时在 ASPX 页面中包含 HTML 文件。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
</head>
<body>
<form id="paypageresponce" runat="server" method="post">
<!--#include file="Response.html"-->
<label>Payment in progress...</label>
</form>
</body>
</html>
加载 HTML 文件后,我触发 Javascript“parent.setPaymentResponseValue(val);” 点击我的申请
解决方案
推荐阅读
- javascript - 获取输入并将其输出到 HTML 文件时出现问题
- c# - 将字符串写入文本文件不起作用?
- c++ - 使用 rdbuf(NULL) 时 istream 对象的意外返回值
- rust - 如何设置这些结构的寿命?
- r - 根据一列中的唯一值比较多个数据帧,并在 R 中的多个数据帧的第二列中查找重叠值
- node.js - 如何使用打字稿创建非公共共享 nodejs 模块
- android - 如何为共享按钮发送二进制内容图像和文本?
- c# - 协程 yield 返回 null
- jestjs - 修复 react-leaflet 测试错误:无法读取属性 '_layerAdd' of null
- regex - 在 GREL/OpenRefine 中匹配的正则表达式