Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angularjs http+;script7002:xmlhttprequest:网络错误0x80070005,访问被拒绝_Javascript_Angularjs_Apache - Fatal编程技术网

Javascript angularjs http+;script7002:xmlhttprequest:网络错误0x80070005,访问被拒绝

Javascript angularjs http+;script7002:xmlhttprequest:网络错误0x80070005,访问被拒绝,javascript,angularjs,apache,Javascript,Angularjs,Apache,我使用angularjs作为前端。服务器端节点js。 前端和后端是不同的服务器。 当我只在IE浏览器中发布http方法获取错误时 错误详细信息: script7002:xmlhttprequest:networkerror 0x80070005,访问被拒绝。 angularjs中的示例代码 //var spec = form data: $http.post('https://test.com/account/register', spec) // handle

我使用angularjs作为前端。服务器端节点js。 前端和后端是不同的服务器。 当我只在IE浏览器中发布http方法获取错误时

错误详细信息:

script7002:xmlhttprequest:networkerror 0x80070005,访问被拒绝。

angularjs中的示例代码

//var spec = form data:
    $http.post('https://test.com/account/register', spec)
            // handle success
            .success(function(data, status) {
                deferred.resolve(data);
            })
            // handle error
            .error(function(data) {
                deferred.reject(data);
            });
apache中的前端设计设置。

我提到了这一点。这对我来说很好

在谷歌AngularJS团队经验丰富的ng开发人员的指导下,我能够实现的解决方案是:

设置非常简单,只需将proxy.html文件放在API的根目录下,使用regex/string表示允许的原点(“master”),并在前端引用脚本,然后从前端脚本(“master”)指向此文件

它的工作原理是在iframe中打开proxy.html文件,并使用
postMessage
与CORS资源通信

与$http和$resource一起工作就像一个符咒

您还可以通过将脚本置于所有JavaScript库的上方来维护普通浏览器的正常功能,包括:

<!--[if lte IE 9]>
<script src="xdomain.js" slave="http://example.org/proxy.html"></script>
<![endif]-->

我提到了这一点。这对我来说很好

在谷歌AngularJS团队经验丰富的ng开发人员的指导下,我能够实现的解决方案是:

设置非常简单,只需将proxy.html文件放在API的根目录下,使用regex/string表示允许的原点(“master”),并在前端引用脚本,然后从前端脚本(“master”)指向此文件

它的工作原理是在iframe中打开proxy.html文件,并使用
postMessage
与CORS资源通信

与$http和$resource一起工作就像一个符咒

您还可以通过将脚本置于所有JavaScript库的上方来维护普通浏览器的正常功能,包括:

<!--[if lte IE 9]>
<script src="xdomain.js" slave="http://example.org/proxy.html"></script>
<![endif]-->