I'm working on a BlackBerry application using phonegap. The problem is, it doesn't get an external JSON from my server on a real device, altough it works well on Ripple.
First, I've added <access subdomains="true" uri="*" />
to the build.xml file.
This is my html/javascript code:
<script>
function onLoad() {
$.ajax({
type : 'GET',
url : "http://myserver.com/api/test.php",
jsonpCallback : 'jsonCallback',
crossDomain : true,
cache : false,
dataType : "jsonp",
jsonp: 'callback',
success: function(json) {
$( ".info" ).html("success");
},
error: function(xhr, textStatus, errorThrown) {
$( ".info" ).html("Error: " + textStatus + ":" + errorThrown);
}
});
}
</script>
<body onload="onLoad();">
...
</body>
When I run this on the Ripple emulator, the success callback is called, but on a real device (BlackBerry 7.0) I get this output:
parsererror: json callback was not called.
As a side note, I have validated the response in JSONLint and it's ok. Also, the response is a valid jsonp response:
jsonCallback({"result":{"status":"ok","testText":"There goes my content"}});
Furthermore, I put code on my server to log access, and it's not being called, so I guess the problem is not my server code, but on the mobile code somewhere.