最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Microsoft Edge: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd - Stac

programmeradmin3浏览0评论

I have a single page html and Angularjs file.

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');
    });
}]);

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>

It works well on Chrome producing the movie titles but gives the errors
SCRIPT7002: XMLHttpRequest: Network Error 0x2, The system cannot find the file specified
and
SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not plete the operation due to error 00002efd. on Microsoft Edge.

I have a single page html and Angularjs file.

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');
    });
}]);

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>

It works well on Chrome producing the movie titles but gives the errors
SCRIPT7002: XMLHttpRequest: Network Error 0x2, The system cannot find the file specified
and
SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not plete the operation due to error 00002efd. on Microsoft Edge.

Share Improve this question asked Nov 2, 2016 at 15:18 shadowCODEshadowCODE 2131 gold badge3 silver badges11 bronze badges 4
  • i have the same problem? solution? – GomuGomuNoRocket Commented Dec 22, 2016 at 14:48
  • I also have this problem – Greg Trevellick Commented Apr 30, 2017 at 17:55
  • Duplicate of a lot of these – Rob Commented Nov 3, 2019 at 18:04
  • Does this answer your question? SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not plete the operation due to error 00002ef3 – Rob Commented Nov 4, 2019 at 1:44
Add a ment  | 

2 Answers 2

Reset to default 3

There are several things which can go wrong.

Try adding the Content-type: application/json; charset=utf-8 header.

Edge does not like VPN and mixed networks. This is probably not the case for you, but good to know.

More to read:

  1. SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not plete the operation due to error 00002ef3

  2. Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

This is an old post but maybe a fresh reply will help somebody learn in case similar problems are found today. In Windows 10 all modern apps runs in AppContainers that are forbidden by isolation rules to send network traffic to the local puter. Edge is regarded as a modern app as seen here: https://blogs.windows./msedgedev/2015/05/11/microsoft-edge-building-a-safer-browser/

For purposes of development you may find tools like ngrok or loopback helpful. I am sure app isolation rules change over time so try to stay up to date with the current limits and realize you are running in an AppContainer if you are using the Edge browser.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论