title: Ajax Request Works via Browser, not via Cordova app in iOS or Android emulators
body: <p>I've got a jQuery Phonegap app I'm building. The following Ajax request works in my browser:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(document).bind("mobileinit", function() {
      $.support.cors = true;
      $.mobile.allowCrossDomainPages = true;
  });
  
  $(document).ready(function() {
  
      $.support.cors = true;
      $.mobile.allowCrossDomainPages = true;
  
      // Load Meet List
      var requestData = {
          'action' : "getmeetlist"
      };
  
      $.ajax({
          type    : 'GET',
          url     : 'http://forum.mastersswimmingqld.org.au/swimman/xmltest.php',
          data    : requestData,
          datatype: 'xml',
          encode  : true,
          error: function(xhr, settings, exception){
               alert('The update server could not be contacted.');
          },
      })
  
      .done (function(data) {
  
          // Render data
          $(data).find('meet').each(function(){
  
              var id = $(this).attr("id");
              var meetName = $(this).find('meetname').text();
  
              var startDate = $(this).find('startdate').text();
  
              $("#meetlist").append("&lt;li&gt;&lt;a id=\"" + id + "\" class=\"meetLink\"&gt;&lt;h2&gt;" + meetName + "&lt;/h2&gt;&lt;p&gt;" + startDate + "&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;");
  
          }); 
  
          $("#meetlist").listview('refresh');
  
      }); 
  </code></pre>
  
  <p>However, when I run it via either emulators it never works. I have the following in my config.xml:</p>
  
  <pre><code>&lt;access origin="*" /&gt;
  </code></pre>
  
  <p>Any suggestions? I've read up on the whitelisting and jQuery pages about Phonegap apps. Still no luck no matter what I do. The only clue I have is that often when I hit this page via the browser(particularly if I arrive via the back button) the list doesn't appear until I hit refresh.</p>
  
  <p>I have put these headers in the php that generates my xml:</p>
  
  <pre><code>header("Access-Control-Allow-Origin: *");
  header('Content-type: text/xml');
  </code></pre>
  
  <p>The later one I put there because when the list doesn't appear, the console shows a message "not well formed", but not usually for the line number where the AJAX requests occur.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks,</p>
  
  <p>David</p>