title: Phonegap and CORS (XHR Status 0) issue
body: <p>I am trying to build an app with Phonegap and the problem and facing some issue with my AJAX calls. All my AJAX calls return a status 0. It seems the webview is honoring the CORS rules and none of my AJAX calls work until I set an <code>Access-Control-Allow-Origin</code> header on my backend.</p>
  
  <p>Once I set the header everything works fine. I tried playing with the <code>res/xml/config.xml</code> and</p>
  
  <p><code>&lt;access origin="*" /&gt;</code> or<br>
  <code>&lt;access origin="*" /&gt;</code> or<br>
  <code>&lt;access origin="*" /&gt;</code> or<br>
  <code>&lt;access origin="*" /&gt;</code>  </p>
  
  <p>in the <code>res/xml/config.xml</code> are all useless and make no difference.</p>
  
  <p>I'm using <code>jQuery</code> to make the AJAX Calls. Here is my code</p>
  
  <h3>index.js</h3>
  
  <pre><code>    $.support.cors;
      $.ajax({
          crossDomain: true,
          type: 'get',
          url: self.endpoint + 'checkDevice/' + deviceID,
          success: function(data) {
              alert('success');
              successCallback();
          },
          error: function(xhr) {
              alert('failure');
              errorCallback();
          },
          complete: function(xhr) {
              $('#validateUser').hide();
          }
      });
  </code></pre>
  
  <h3>res/xml/config.xml</h3>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;widget id="com.app.tap" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"&gt;
      &lt;preference name="loglevel" value="DEBUG" /&gt;
      &lt;name&gt;App Tap&lt;/name&gt;
      &lt;description&gt;
          Hello World sample application that responds to the deviceready event.
      &lt;/description&gt;
      &lt;author email="support@phonegap.com" href="http://phonegap.com"&gt;
          PhoneGap Team
      &lt;/author&gt;
      &lt;preference name="permissions" value="none" /&gt;
      &lt;preference name="phonegap-version" value="3.5.0" /&gt;
      &lt;preference name="orientation" value="default" /&gt;
      &lt;preference name="target-device" value="universal" /&gt;
      &lt;preference name="fullscreen" value="true" /&gt;
      &lt;preference name="webviewbounce" value="true" /&gt;
      &lt;preference name="prerendered-icon" value="true" /&gt;
      &lt;preference name="stay-in-webview" value="false" /&gt;
      &lt;preference name="ios-statusbarstyle" value="black-opaque" /&gt;
      &lt;preference name="detect-data-types" value="true" /&gt;
      &lt;preference name="exit-on-suspend" value="false" /&gt;
      &lt;preference name="show-splash-screen-spinner" value="true" /&gt;
      &lt;preference name="auto-hide-splash-screen" value="true" /&gt;
      &lt;preference name="disable-cursor" value="false" /&gt;
      &lt;preference name="android-minSdkVersion" value="7" /&gt;
      &lt;preference name="android-installLocation" value="auto" /&gt;
      &lt;gap:plugin name="org.apache.cordova.battery-status" /&gt;
      &lt;gap:plugin name="org.apache.cordova.camera" /&gt;
      &lt;gap:plugin name="org.apache.cordova.media-capture" /&gt;
      &lt;gap:plugin name="org.apache.cordova.console" /&gt;
      &lt;gap:plugin name="org.apache.cordova.contacts" /&gt;
      &lt;gap:plugin name="org.apache.cordova.device" /&gt;
      &lt;gap:plugin name="org.apache.cordova.device-motion" /&gt;
      &lt;gap:plugin name="org.apache.cordova.device-orientation" /&gt;
      &lt;gap:plugin name="org.apache.cordova.dialogs" /&gt;
      &lt;gap:plugin name="org.apache.cordova.file" /&gt;
      &lt;gap:plugin name="org.apache.cordova.file-transfer" /&gt;
      &lt;gap:plugin name="org.apache.cordova.geolocation" /&gt;
      &lt;gap:plugin name="org.apache.cordova.globalization" /&gt;
      &lt;gap:plugin name="org.apache.cordova.inappbrowser" /&gt;
      &lt;gap:plugin name="org.apache.cordova.media" /&gt;
      &lt;gap:plugin name="org.apache.cordova.network-information" /&gt;
      &lt;gap:plugin name="org.apache.cordova.splashscreen" /&gt;
      &lt;gap:plugin name="org.apache.cordova.vibration" /&gt;
      &lt;icon src="icon.png" /&gt;
      &lt;icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" /&gt;
      &lt;icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" /&gt;
      &lt;icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" /&gt;
      &lt;icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" /&gt;
      &lt;icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" /&gt;
      &lt;icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" /&gt;
      &lt;icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" /&gt;
      &lt;icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" /&gt;
      &lt;icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" /&gt;
      &lt;icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" /&gt;
      &lt;icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" /&gt;
      &lt;icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" /&gt;
      &lt;icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" /&gt;
      &lt;gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" /&gt;
      &lt;gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" /&gt;
      &lt;gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" /&gt;
      &lt;gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" /&gt;
      &lt;gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" /&gt;
      &lt;gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" /&gt;
      &lt;gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" /&gt;
      &lt;gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" /&gt;
      &lt;gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" /&gt;
      &lt;gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" /&gt;
      &lt;gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" /&gt;
      &lt;access origin="*" /&gt;
  &lt;/widget&gt;
  </code></pre>