Answer the question
In order to leave comments, you need to log in
How is external data exchange done in Cordova/Phonegap?
I decided to try developing mobile applications for myself
using the Cordova framework. Yes, I know it's not the best way. Naive code is much better. To study the framework, I decided to make a simple client for a news site. Fortunately, the site has an RSS feed. The first thought was to use an Ajax request. But cross-domain requests are blocked by the browser, and the use of JSONP is not suitable in every case. So what's the best way to do it? Enter an intermediate server that receives XML as input and returns JSONP? Resource intensive.
Maybe there is another way out? How is the exchange of external data organized in Cordova?
Answer the question
In order to leave comments, you need to log in
Yes, I know it's not the best way.
It's not entirely obvious, but when the index.html of an html5 app is opened in Cordova, it's opened using the file:// protocol - in this case, cross-domain request policies don't apply.
Therefore, what does not work due to CORS in your browser during debugging will work fine on the device.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question