I have an HTML5/JavaScript app that was originally written to run in certain cars. Basically, I need to set up my app to run in the browser for a simple demo to a customer.
I'm using jQuery .ajax which is causing problems due to the Same Origin Policy. I have found plenty of ways to disable this in desktop browsers, but not mobile ones.
My goal is to demo the app on an iPad in Mobile Safari. Is there any way to temporarily disable the Same Origin Policy on an iPad?
I had the same problem with a sencha app. I resolved by setting a base path to my javascript ajax calls, example:
var BASEPATH = 'http://192.168.1.200/myapp';
$.ajax({
url: BASEPATH+'/someaction'
});
And from the mobile I access it with http://192.168.1.200/myapp
My problem was that the from mobile I get access only with IP but ajax call were point to localhost.
Hope this trick helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With