title: Getting JSON data from server with Phonegap for BlackBerry
body: <p>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.</p>
  
  <p>First, I've added <code>&lt;access subdomains="true" uri="*" /&gt;</code> to the build.xml file.</p>
  
  <p>This is my html/javascript code:</p>
  
  <pre><code>&lt;script&gt;
  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);
        }
  });
  }
  &lt;/script&gt;
  &lt;body onload="onLoad();"&gt;
  ...
  &lt;/body&gt;
  </code></pre>
  
  <p>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: </p>
  
  <blockquote>
    <p>parsererror: json callback was not called.</p>
  </blockquote>
  
  <p>As a side note, I have validated the response in JSONLint and it's ok. Also, the response is a valid jsonp response:</p>
  
  <pre><code>jsonCallback({"result":{"status":"ok","testText":"There goes my content"}});
  </code></pre>
  
  <p>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. </p>