Microsoft Edge:XMLHttpRequest:网络错误0x2efd,由于错误00002efd无法完成操作

sha*_*ODE 10 javascript ajax angularjs microsoft-edge

我有一个页面的HTML和Angularjs文件.

App.js

angular
.module('vod', [])
.controller('moviesController', ['$http', function ($http) {
    var self = this;
    self.movies = [];
    $http.get('http://localhost:8080/movies/').then(function (response) {
        self.movies = response.data;
    }, function (errResponse) {
        console.error('Error while fetching movies');
    });
}]);
Run Code Online (Sandbox Code Playgroud)

HTML

<!DOCTYPE html>
<html>
    <head>
        <title>Angular</title>
        <script src="angular.min.js"></script>
        <script src="app.js"></script>
    </head>
    <body ng-controller="moviesController as ctrl"
          ng-app="vod">
        <div ng-repeat="movie in ctrl.movies">
            <span ng-bind="movie.title"></span>
        </div>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

它运作良好,在Chrome制作电影的标题,但给人的错误
SCRIPT7002: XMLHttpRequest: Network Error 0x2, The system cannot find the file specified

SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd.微软的边缘.

小智 3

有几件事可能会出错。

尝试添加Content-type: application/json; charset=utf-8标题。

Edge 不喜欢 VPN 和混合网络。您的情况可能并非如此,但很高兴知道这一点。

更多内容请阅读:

  1. SCRIPT7002:XMLHttpRequest:网络错误 0x2ef3,由于错误 00002ef3,无法完成操作

  2. 为什么 Microsoft Edge 可以打开一些本地网站,但不能打开其他网站,这些网站的域名在主机文件中路由到 127.0.0.1