Microsoft Edge: XMLHttpRequest: network error 0x2efd, operation could not be completed due to error 00002efd

I have one html file and 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'); }); }]); 

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 great on Chrome, creating movie titles, but gives errors
SCRIPT7002: XMLHttpRequest: Network Error 0x2, The system cannot find the file specified
and
SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd. on Microsoft Edge.

+9
source share
1 answer

There are a few things that may go wrong.

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

Edge does not like VPNs and mixed networks. This probably does not apply to you, but it is good to know.

Read more:

0
source

Source: https://habr.com/ru/post/1259168/


All Articles