- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm aware that there are several threads concerning this topic but since I tried the different approaches to solve this problem without succeeding I'll post the description of the problem in my specific case.
Ajax-calls work perfectly using the Simulate-Tab in Intel XDK-IDE.
In App-Preview and in the Build-Version the ajax-call fails with readyState: 0, status: 0 and statusText: "error". Nontheless, the responseText contains exactly the correct answer that I'm expecting from the server.
I tried different calls like $.post or $.ajax with type: "POST". I don't think it's a CORS-Problem as I'm getting the correct Text in responseText.
The current implementation:
$.ajax({
type: "GET",
url: config.serverUrl + "/myPage",
data: JSON.stringify(data)
})
.done(function( resp ) {
if(resp.state != "success")
return false;
else{
//Success!! go party
//window.location.href = "some-other-page.html";
}
})
.fail(function(e, status, error){
alert(e.responseText + "\n" + e.statusText + "\n" + error);
});
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you check this FAQ > https://software.intel.com/en-us/xdk/faqs/app-designer#ajax-jquery-one-fail <
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page