- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi!
My ajax calls are not works in the new xdk version!
My code:
jQuery.ajax({ type:'GET', url:'http://time.jsontest.com/', error: function(response, d, a){ alert(response + d + a) ; }, success: function (response){ alert(JSON.stringify(response)); } });
Response in xdk emulator on windows 7:
{"time":"12:31:52 PM","milliseconds_since_epoch":1425040312408,"date":"02-27-2015"}
Response on phone, after building cordova hybrid android app and install it (xiaomi redmi note and samsung galaxy note 3)
[object Object]errorNot Found
Why not works it? Help please! Thanks!
- Tags:
- HTML5
- Intel® XDK
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi Raiden,
if you're using the latest version of Intel XDK (1816) that's the issue. We had the very same problem. When we update from 1621 ajax calls stopped working, together with simpler things like anchor tags (!!!). We had to revert back to version 1621. Please, refer to this topic in order to rollback.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Have you included intelxdk.js and xhr.js in your index.html?
Have you been able to run it on your device using App Preview?
Swati
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
@Cristian, the build system is independent of the XDK UI. The new version should not affect the functioning of built app.
Swati
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Ajax calls work good for me in 1816 version.
$.ajax({
type: "GET", url: url + "/test", dataType: 'json', success: function(data){ if (data[0].err) { $("#data").append(data[0].err); } else { $("#data").html(data[0].status); } } });
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
In the past I had this issue. I discovered that I had appframework AND jquery files. It caused the problem. I removed the appframework file and all worked well.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Yes, i have also only included the appframework js scripts.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Remove it and test again!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
SWATI S.: I have included both js file in the index.html, and ajax calls are running in AppPreview.
It runs everywhere, except on phone (after building cordova android app)
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I understand that this is because of AppFrameWork, i removed it and using jquery mobile works with ajax calls. Earlier (before upgrading XDK) this was working perfectly fine with AppFrameWork 2.2., If you guys have a solution to it with AppFrameWork, please post here. thanks
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi.
You must read this link for ajax call crossdomain: http://www.funcion13.com/2012/04/12/como-realizar-peticiones-ajax-cross-domain-jsonp-jquery/
En the php file you must include this instruction, header('Access-Control-Allow-Origin: *'); this is important to access to the file an get the json objet.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Important that do not include additional domains in the section Domain list, just use the one that comes by default * and if you can update your Intel XDK to version 1816
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I'm hearing different things for this ajax issue. Please load this attached project which makes ajax call using jQuery. I'm successfully able to build for Cordova Android and it runs on device as well. If it does not run for you, please send your device info - which device are you using, which android OS version- and what errors you get while you run this app.
Hope this helps.
Swati
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Your projects's ajax call works on my phone, but my own doesn't.
I did the following:
Start a new project --> Templates --> Blank --> HTML 5 + Cordova
I copied your ajax script, button, intelxdk.js, xhr.js and jquery file.
Next: Build --> Cordova Hybrid --> Android.
I installed the apk file on my mobile. The ajax works fine in the emulator, but not on my mobile.
It throws an error: [Object]errorNot Found.
My phones: Xiaomi redmi note and Samsung note 3. Android version on both device: 4.4
Why doesn't it work?
Thank you!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi Raiden,
Did you solve this issue ? the Not Found error ?
Thanks
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi Raiden,
Did you find any solution to the problem ? I'm having the same problem when I do the Ajax call appears Error: Not found Thanks
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hello,
There is an issue, when you create a project from a template, the Domain List is left empty in the Projects> Build Settings and that's why the app cannot access other domain through ajax calls. I've reported the bug. Meanwhile please go to Projects Page and under Build Settings, put a * in the Domain List box. You'll have to do this for all the builds that you are using.
Thanks,
Swati
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi SWATI,
I tried :
function TestAjax()
{
$.ajax({
type:'GET',
url:'http://time.jsontest.com/',
error: function(response, d, a){
alert(response + d + a) ;
},
success: function (response){
alert(JSON.stringify(response));
}
});
}
and it runs adding * into Build settings->Domain List .
unfortunately, my function below doesn't run:
function CheckMobile()
{
var url = 'https://assistenza.octaviangaming.com/renting/api/?mobile_num=' +
document.getElementById("txtNumCell").value;
$.ajax({
url: url,
type: 'GET',
success: function(data, textStatus, jqxhr){
CheckMobileEnabling_success(data, textStatus, jqxhr)},
error: CheckMobileEnabling_err});
}
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
@Marco, what error do you get? Which android version are you testing this on?

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite