Search code examples
win-universal-appwinjswindows-10-universal

WinJS App - Not able make ajax request using WinJs.xhr


I'm developing a simple app using WinJS for Windows 8 and 10. The app makes an Http request using Winjs.xhr.

I developed Web API hosted on a server with CORS enabled into that. Now, when I install my Win app in development machine (where API(s) are hosted), Win App is able to download the data.

On remote computer it fails. It executes error code block and returns readyState=4, status=0.

See detail description of problem I'm facing here


Solution

  • Finally Solved after spending my 3 days behind this searching everywhere. I have been using http://192.168.4.134:9084/.... URL for sending the request. Initially, I had set app capability to Internet(client) and Internet(client & server). Later while rethinking I realized that since it's routed through network, I may also require Private Network (Client & Server) to be checked marked.

    for now this has solved the problem, and created a question that "Do I need to check mark it when I will publish it for store?"

    Another off topic question, How to sideload this app in all computers at once assuming that all those PCs are connected with single AD server under one domain?