I am working on a HTML5 app that needs to get data from a server. To do so I need to use Javascript, see below code. But no matter what I do, it always returns 0. It should, with the below code, return a 403 with correct url, or 404 with wrong url, it does neither. The container app should allow cross site scripting. I have the app running in the Intel App Preview. Windows 10 / Android 5.1.1 Sony Experia Z1 Compact.
What I want it to do is: connect to server, give server right username;password, return a package of data, to be used in App.
Tested these:
 - Wifi works
 - as does internet connection
 - jQuery version of the below.
    var xhr = new XMLHttpRequest();
    xhr.open("GET", "https://pageiuse.com", true);
    xhr.onload = function(){
    if (xhr.readyState == 4) {
        if(xhr.status == 200) {
            var json_string = xhr.responseText;
            var json = JSON.parse(json_string);
            toastMessage("Succes!");
        } else if(xhr.status == 404) {
            toastMessage("404!");
        } else {
            toastMessage("Error!!! " + xhr.status);
        }
    } else {
        toastMessage("readyState " + xhr.readyState);
    }};
    xhr.send(null);
All help is welcome, or suggestions on how to debug this.
*Update, there is data coming back when I use xhr.responseText, but xhr.status stays 0. Been digging into the "Cordova Whitelisting", but nothing getting better for now.
