Apache Cordova Windows Phone 8 App ajax request request status 0

I developed an application using Apache Cordova Windows Phone 8 framework. I am working on an emulator.

My first page makes an ajax call to the WCF service to display a list of employees based on user input. I showed the data returned by an Ajax call on my page. Everything works fine before that.

The problem starts when I click the back button of the emulator. The back button returns me to the beginning of the emulator, where we see all the application icons.

When I click on the icon of my application, it opens index.html, which is my main page. When I enter the search criteria and press the search button, the ajax call returns the request status 0.

I can’t understand why this is happening and find nothing useful in the Internet search. My ajax call is

// Require cross-site scripting so enable it here (calling different website) $.support.cors = true; var jsonData = { 'searchCriteria': 'Raj'}; $.ajax({ type: "POST", url: "http://hqit116/EmployeeWCFService/EmployeeWCFServices.svc/GetEmployeeData", contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify(jsonData), processData: true, success: onSuccess, error: OnFailure }); 

Can someone please help me with this. It really stops me with my next job.

+4
source share

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


All Articles