I have a simple jQuery Mobile application that is hosted on one server (server1.com) which includes some php pages that query a database hosted on another server (server2.com).
This all works fine when everything (jQuery Mobile website and Database) is hosted on the same server but when they are separated it doesn't display any of the data. I've been looking at the Configuring Defaults documentation at:
http://api.jquerymobile.com/global-config/
and specifically the allowCrossDomainPages option. I've created a new script file called custom-scripting.js which contains the following:
and the called it as recommended:
but my PHP page is still not making the request to server2.com. I was hoping that setting allowCrossDomainPages: true would allow the PHP page to make the request to the external server.
Anyone else setup a similar configuration with jQuery Mobile that needs to retrieve data from an external server using php?
This all works fine when everything (jQuery Mobile website and Database) is hosted on the same server but when they are separated it doesn't display any of the data. I've been looking at the Configuring Defaults documentation at:
http://api.jquerymobile.com/global-config/
and specifically the allowCrossDomainPages option. I've created a new script file called custom-scripting.js which contains the following:
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
allowCrossDomainPages: true
});
});
and the called it as recommended:
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="custom-scripting.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
but my PHP page is still not making the request to server2.com. I was hoping that setting allowCrossDomainPages: true would allow the PHP page to make the request to the external server.
Anyone else setup a similar configuration with jQuery Mobile that needs to retrieve data from an external server using php?


