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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -