0

I am using Visual studio 2015 and ionic and i have been able to build for windows phone 8.1. I created a login page that is to query a php on a different server but i get a problem like this SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd. index.html error.
My code trying to make a request is

var login = function(name, pw) {
      return $q(function(resolve, reject) {
          $http.post('http://192.167.180.1//logn/sear.php',{ 'pin': pw }).then(
      function(result) {
        // No result here..
        var re=result.data.split(",");
        console.log(re[3]);
        if ((re[0] == 0 )) {
        // Make a request and receive your auth token from your server
        storeUserCredentials(re[2]);
        useCredentials(re[1]+" "+re[3]+" "+re[4]);
        console.log(LOCAL_TOKEN_KEY);
        resolve('Login success.');
      } else if(result.data == 1) {
        reject('Login Failed.');
      }


      }, function(err) {
       // $scope.response = err.records;
       console.log("error");

      });


    }); 

  };

1 Answers1

-1

When you are facing this error while building a Win 8 Phone App, you might want to add private network capability to app manifest.

Credits for the guy who helped me out: https://sonyarouje.com/tag/network-error/ - there you'll find step-by-step instruction how to do it.

There is also another answer how to do it on SO: WinJS.xhr: Network Error 0x2efd, Could not complete the operation due to error 00002efd

Community
  • 1
  • 1
tomalone
  • 404
  • 3
  • 12