首页 > 解决方案 > 如何从不同的域访问 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);” 点击我的申请

标签: javascriptasp.netcross-domain

解决方案


推荐阅读