cordova - XMLHttpRequest and Phonegap... Same Origin Policy or not? -
i'm still new phonegap , working android sdk days now. @ least wanted xmlhttprequest
data server. knew same origin policy before , asked myself, how should work "native app".
i searched internet , found topics, people telling others, there no same origin policy on phonegap, because uses file://
protocol , additionally there domain whitelist in it's config.xml
.
on other hand there bunch of topics of people having problems xhr's , others told them, because of same origin policy...
well, confused, used - on regular websites - working xmlhttprequest
snippet , put phonegap app. tried virtual device, request not working.
now asked myself questions:
- who right? there same origin policy on phonegap or not?
if yes:
what function has domain whitelist?
what's best way still data of server?
yes, people correct same origin policy needed in webapps not hybrid phonegap apps.
you need check domain whitelist, check in config.xml
in res
--> xml
folder.
for accessing xml web services need ensure soap message correctly formed. try catch exact error.
Comments
Post a Comment