Answered: Using PhoneGap - AJAX JSON or JSONP requests ?
Answered: Using PhoneGap - AJAX JSON or JSONP requests ?
Hello,
I've been developing a Sencha Touch 1.1 project. It uses standard AJAX queries with Ext.Data.Store and JSON results. I tried the application in a browser by having the Html/JS files on the server which also returns JSON through AJAX queries.
It works greatly in that way.
Now, I've recently set up my Sencha Touch 1.1 project with PhoneGap to use it with Android. Which means I now have my Html/JS files wrapped in my Android app thanks to PhoneGap. The files are now in the phone, so to speak.
But my AJAX calls on the server don't work from the android app on my phone. (Even though the server can be reached from my phone).
I've been thinking the problem is due to the fact that i use standard AJAX JSON calls in the app.
Since the Html and JS files are located in the phone and i try to reach a distant server for my AJAX calls, do i need to setup JSONP calls with my app instead? Shouldn't standard AJAX/JSON queries work in that case?