EDIT: Solution for JQuery Mobile + Phonegap AJAX Problems:
subdomains="true"
property in config.xml is not working in phonegap 2.9.0, every request to a subdomain will return 200 but $.ajax won't fire the success function (and $.getJSON won't fire anyways).
Also: Syntax *.domain.tld
as stated in the official doc is not working, only way I found to solve that problem: Setting access origin and acces uri to "*"
(all)
<access origin="*"/>
<access uri="*"/>
I'm working on a mobile application using the jQuery Mobile Framework and Phonegap. I've just added an AJAX request to my application which is used to get data from my webserver. The page is correctly loading but Android (4.1.2) never fires the AJAX event or never gets a request from the Webserver, in fact it's just hanging on the loading spinner.
Strange thing about this is, that I already use an AJAX request to the same server (but with different domain) that works perfectly fine:
$.getJSON("[...]checkupdate.php?callback=?", function(data){
[...]
})
I've tried to do the second request with $.getJSON too and it worked on my computer but failed on Android. I started looking around for a solution and found out, that setting the cache to false in $.ajax might help so I rewrote my code but it's still not working.
$.ajax({
cache : false,
type: 'GET',
url: requestURL,
dataType: 'jsonp',
context: document.body,
success: function(data){
[...]
}});
Is there anything else to do to get this to work?