Software Archive
Read-only legacy content
17060 Discussions

Java script and AJAX working in Emulator but not on my device

Adil_K_
Beginner
801 Views

Could someone please help me, I tried to create a simple application that can view information from a database. It is working in the emulation mode, but when I try the application on my device it does not work. I am new to Intel XDK, any help will be greatly appreciated.

0 Kudos
1 Solution
Diego_Calp
Valued Contributor I
801 Views

Hi Adil,

I think that the problem is that in your device this won't work:

http://localhost/Hospital/GetPatientData.php

This url should be the server's one.

Regards

Diego

 

View solution in original post

0 Kudos
5 Replies
PaulF_IntelCorp
Employee
801 Views

It's probably related to the whitelist settings on the Projects tab, but it's hard to say precisely. Did you try some of the demo/sample apps to see how they are configured? Especially the whitelist settings.

Also, try using the Debug tab, it will provide a more accurate view of running your app on a real system. See this doc for even more options > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview

0 Kudos
Adil_K_
Beginner
801 Views

Thanks Paul for the response.

I have tried the whitelist settings. I will upload some pictures of what I have done, so that the problem can be a bit more clear.

Project 1.JPG

Project 2.JPG

Project 3.JPG

 

Project 4.JPG

Project 5.JPG

Project 6.JPG

0 Kudos
Diego_Calp
Valued Contributor I
802 Views

Hi Adil,

I think that the problem is that in your device this won't work:

http://localhost/Hospital/GetPatientData.php

This url should be the server's one.

Regards

Diego

 

0 Kudos
PaulF_IntelCorp
Employee
801 Views

Hi Adil, Deigo's comment is the most likely cause of your troubles. Also, see this blog for some useful getting started hints regarding how a Cordova app differs from a web app > http://blogs.intel.com/evangelists/2015/12/31/five-useful-tips-on-getting-started-building-cordova-mobile-apps-with-the-intel-xdk/

0 Kudos
Adil_K_
Beginner
801 Views

Thank you Diego and Paul, I have resolved my problem. I had to remove the hidden frame part, change the whitelist settings, and change the local host to my IP address in the html portion of the code.

0 Kudos
Reply