title: PhoneGap: load data from external sources
body: <p>I would like to create a web app with phonegap (I'm trying on Android emulator), but I have a problem with the "same domain policy": is there any way to disable this restriction. I need to load html/json data from an external server (not my own, so I can't modify it), but when I try to get data JQuery returns an undefined object. Here's my code:</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="ISO-8859-1"&gt;
          &lt;title&gt;Title&lt;/title&gt;
          &lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $.ajaxSetup ({
                  cache: false
              });
              var ajax_load = "&lt;img src='img/load.gif' alt='loading...' /&gt;";
              var jsonUrl = "external url";
                  $("#result").html(ajax_load);
                  $.getJSON(jsonUrl, function(json) {
                      var result = json.responseData;
                      $("#data").html("Result: " + result);
                  });
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="data"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>PhoneGapTestActivity</strong></p>
  
  <pre><code>public class PhoneGapTestActivity extends DroidGap {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          super.loadUrl("file:///android_asset/www/index.html");
      }
  }
  </code></pre>
  
  <p>Searching online and reading other questions, I tried to set the whitelist in the file <strong>phonegap.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;phonegap&gt;
      &lt;access origin="*" subdomains="true" /&gt;
  &lt;/phonegap&gt;
  </code></pre>
  
  <p>But what I got is: "Result: undefined".
  Thanks a lot!</p>
  
  <p>EDIT: After many tries, I noticed that the request works (I received the data), but there was some issues while accessing json data contents, but now it works!.
  Thanks for all answers.</p>