3

I am trying to design some software to be distributed on private mobile devices (Android, iOS etc).

I would like to write the software with HTML/CSS/JavaScript and use something like Sencha Touch, PhoneGap or similar.

The software needs to write to a local database on the device and when it gets connectivity, post the data (securely) to a remote database on a web server.

I believe my problem will be posting the data to the server. As far as I can tell AJAX can use JSONP to request data cross-domain, but not to send data (at least not with POST method).

Can this be done using JavaScript? Perhaps Sencha Touch, PhoneGap or other mobile-app-compiling solutions have native storage and cross-domain posting methods?

tomturton
  • 1,278
  • 2
  • 13
  • 17

1 Answers1

1

JSONP technically is a hack. CORS is the correct way to implement cross domain calls if you have control over your web service. This is a great post explaining how to enable CORS support in Web API. if you use some other technology for developing your web service, you can get tons of information from internet on how to CORS enable it .

Nishanth Nair
  • 2,975
  • 2
  • 19
  • 22