I am building a semi dynamic app in html5 w/jquerymobile, target atm. is iOS to begin with.
But the problem is that i need to contact a webservice with a (request)header paramater, and this is not doable.
My question might be very elementary, but since i’m developing in netbeans i ran into the problem of not being able to get data from crossdomain.
(Getting to the point). In phonegap/{non native “offline” apps}. How do i set the domain/is there a workaround for making http get/post requests with headerparams?
If you are using Phonegap the web application will run off of the file:// protocol and is not bound by cross domain restrictions.
EDIT:
If you are using jQuery Mobile and Phonegap you will need to set
$.support.corsand$.mobile.allowCrossDomainPagesto true.From the jQueryMobile docs:
Since jQuery Mobile relies on jQuery core’s $.ajax() functionality, $.support.cors must be set to true to tell $.ajax to load cross-domain pages. We’ve heard reports that webviews on some platforms, like BlackBerry, support cross-domain loading, but that jQuery core incorrectly sets $.support.cors value to false which disables cross-domain $.ajax() requests and will cause the page or assets to fail to load.