- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My Application need to connect to an server, it works on IOS, but on Android not.
On IOS they return code 200, 404 etc
On Android they only return 0, for error, succes, anything!
My code:
var xhttp = new XMLHttpRequest(); xhttp.open("GET", HTTP, true); xhttp.onreadystatechange = function() { alert(xhttp.status); if ((xhttp.readyState == 4 && xhttp.status == 200) || (xhttp.readyState == 4 && xhttp.status == 0)) { document.getElementById("SIFrame").value = xhttp.responseText; TA = TXTIFrame.value; lines=TA.split("\n"); document.getElementById("LineE").innerHTML = lines[LE]; A1B.innerHTML = lines[R1]; A2B.innerHTML = lines[R2]; A3B.innerHTML = lines[R3]; A4B.innerHTML = lines[R4]; A5B.innerHTML = lines[R5]; activate_page("#readerpage"); } else { if(MSG == false && xhttp.status == 404) { alert("Esse arquivo não pode ser encontrado, verifique sua conexão com a internet!") MSG = true; } }
Thanks for the help!
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Joao> maybe this post helps you: https://software.intel.com/en-us/comment/1867247#comment-1867247, thread Paul F. (Intel) Wed, 04/06/2016 - 08:57
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Joao> maybe this post helps you: https://software.intel.com/en-us/comment/1867247#comment-1867247, thread Paul F. (Intel) Wed, 04/06/2016 - 08:57
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recommend that you add add an * (asterisk) to the network request field and http://* in the intent field on the projects panel. These configuration settings are visible for Cordova projects under the Build settings sections for the desired mobile platform. After you have successfully tested your project, the appropriate domain name (http://my-server.com) to the intent field. If your have more domain names, add them to the field separated by commas.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page