title: Phone gap ajax call fails when debug=false
body: <p>I have a problem with ajax call using phone gap. Excatly when i'am in debug mode everything work great but after switch to debug fals when i want put my app to android store then ajax fails. Hers code : </p>
  
  <p>Config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!-- config.xml reference: https://build.phonegap.com/docs/config-xml --&gt;
  &lt;widget xmlns     = "http://www.w3.org/ns/widgets"
          xmlns:gap = "http://phonegap.com/ns/1.0"
          id        = "Lead Info"
          version   = "1.0.0"&gt;
  
      &lt;name&gt;LEADInfo&lt;/name&gt;
  
      &lt;description&gt;
  
      &lt;/description&gt;
  
      &lt;author &gt;
          FASTDATA Team
      &lt;/author&gt;
      &lt;icon src="fa-cogs.png"   /&gt;
      &lt;!--
          If you do not want any permissions to be added to your app, add the
          following tag to your config.xml; you will still have the INTERNET
          permission on your app, which PhoneGap requires.
      --&gt;
      &lt;preference name="permissions"                value="none"/&gt;
  
      &lt;!-- Customize your app and platform with the preference element. --&gt;
      &lt;preference name="orientation"                value="default" /&gt;        &lt;!-- all: default means both landscape and portrait are enabled --&gt;
      &lt;preference name="target-device"              value="universal" /&gt;      &lt;!-- all: possible values handset, tablet, or universal --&gt;
      &lt;preference name="fullscreen"                 value="true" /&gt;           &lt;!-- all: hides the status bar at the top of the screen --&gt;
      &lt;preference name="webviewbounce"              value="true" /&gt;           &lt;!-- ios: control whether the screen 'bounces' when scrolled beyond the top --&gt;
      &lt;preference name="prerendered-icon"           value="true" /&gt;           &lt;!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen --&gt;
      &lt;preference name="stay-in-webview"            value="false" /&gt;          &lt;!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in --&gt;
      &lt;preference name="ios-statusbarstyle"         value="black-opaque" /&gt;   &lt;!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar --&gt;
      &lt;preference name="detect-data-types"          value="true" /&gt;           &lt;!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system --&gt;
      &lt;preference name="exit-on-suspend"            value="false" /&gt;          &lt;!-- ios: if set to true, app will terminate when home button is pressed --&gt;
      &lt;preference name="show-splash-screen-spinner" value="true" /&gt;           &lt;!-- ios: if set to false, the spinner won't appear on the splash screen during app loading --&gt;
      &lt;preference name="auto-hide-splash-screen"    value="true" /&gt;           &lt;!-- ios: if set to false, the splash screen must be hidden using a JavaScript API --&gt;
      &lt;preference name="disable-cursor"             value="false" /&gt;          &lt;!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app --&gt;
      &lt;preference name="android-installLocation"    value="auto" /&gt;           &lt;!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. --&gt;
      &lt;!--
          Define a specific version of PhoneGap to build into your app.
          &lt;preference name="phonegap-version"       value="3.5.0" /&gt;
      --&gt;
      &lt;preference name='phonegap-version' value='cli-5.2.0' /&gt;
  
      &lt;!-- Plugins --&gt;
  
      &lt;!-- Core plugins --&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;!-- Define app splash screen for each platform. --&gt;
      &lt;gap:splash src="res/screen/android/screen-ldpi-portrait.png"       gap:platform="android" gap:qualifier="port-ldpi" /&gt;
      &lt;gap:splash src="res/screen/android/screen-mdpi-portrait.png"       gap:platform="android" gap:qualifier="port-mdpi" /&gt;
      &lt;gap:splash src="res/screen/android/screen-hdpi-portrait.png"       gap:platform="android" gap:qualifier="port-hdpi" /&gt;
      &lt;gap:splash src="res/screen/android/screen-xhdpi-portrait.png"      gap:platform="android" gap:qualifier="port-xhdpi" /&gt;
      &lt;gap:splash src="res/screen/blackberry/screen-225.png"              gap:platform="blackberry" /&gt;
      &lt;gap:splash src="res/screen/ios/screen-iphone-portrait.png"         gap:platform="ios"     width="320" height="480" /&gt;
      &lt;gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png"      gap:platform="ios"     width="640" height="960" /&gt;
      &lt;gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios"     width="640" height="1136" /&gt;
      &lt;gap:splash src="res/screen/ios/screen-ipad-portrait.png"           gap:platform="ios"     width="768" height="1024" /&gt;
      &lt;gap:splash src="res/screen/ios/screen-ipad-landscape.png"          gap:platform="ios"     width="1024" height="768" /&gt;
      &lt;gap:splash src="res/screen/windows-phone/screen-portrait.jpg"      gap:platform="winphone" /&gt;
  
      &lt;gap:config-file platform="ios" parent="CFBundleShortVersionString"&gt;
      &lt;string&gt;100&lt;/string&gt;
      &lt;/gap:config-file&gt;
  
      &lt;!--
          Define access to external domains.
  
          &lt;access /&gt;            - a blank access tag denies access to all external resources.
          &lt;access origin="*" /&gt; - a wildcard access tag allows access to all external resource.
  
          Otherwise, you can specify specific domains:
  
          &lt;access origin="http://phonegap.com" /&gt;                    - allow any secure requests to http://phonegap.com/
          &lt;access origin="http://phonegap.com" subdomains="true" /&gt;  - same as above, but including subdomains, such as http://build.phonegap.com/
          &lt;access origin="http://phonegap.com" browserOnly="true" /&gt; - only allows http://phonegap.com to be opened by the child browser.
      --&gt;
  
      &lt;feature name="http://api.phonegap.com/1.0/network"/&gt;
      &lt;!-- Added the following intents to support the removal of whitelist code from base cordova to a plugin --&gt;
      &lt;!-- Whitelist configuration. Refer to https://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html --&gt;
      &lt;plugin name="cordova-plugin-whitelist" version="1" /&gt;
  
  
     &lt;access origin="*" /&gt;
  
  
      &lt;allow-intent href="http://*/*" /&gt;
      &lt;allow-intent href="https://*/*" /&gt;
      &lt;allow-intent href="tel:*" /&gt;
      &lt;allow-intent href="sms:*" /&gt;
      &lt;allow-intent href="mailto:*" /&gt;
      &lt;allow-intent href="geo:*" /&gt;
      &lt;platform name="android"&gt;
          &lt;allow-intent href="market:*" /&gt;
      &lt;/platform&gt;
      &lt;platform name="ios"&gt;
          &lt;allow-intent href="itms:*" /&gt;
          &lt;allow-intent href="itms-apps:*" /&gt;
      &lt;/platform&gt;
  
  &lt;/widget&gt;
  </code></pre>
  
  <p>And Function : </p>
  
  <pre><code>function log_in() {
  
      window.login_data = $("#login_form").serializeArray();
      window.username = login_data[0].value.toUpperCase();
      window.password = login_data[1].value;
      if (window.password == "" &amp;&amp; window.username == "") {
          window.username = "a";
          window.password = "a";
      }
  
      var serwer_url = window.serwer;
      var index = serwer_url.indexOf("/");
      index = index + 1;
      window.header = serwer_url.substr(0, index);
      window.rest_url = serwer_url.substr(index + 1);
  
      $.ajax({
          type: 'GET',
          async: true,
          url: window.header + window.username + ":" + window.password + "@" + window.rest_url + "/rin/mob_leady?resultsPerPage=100",
          processData: true,
          data: {},
          crossDomain: true,
          dataType: "json",
          beforeSend: load_start(),
          success: function (data) {
              window.test = data;
              console.log("autoryzowano");
              $("#login_error").css("display", "none");
              $("#leeds-content").load('auth_app.html');
              $("#leeds-content").css("display", "block");
              $("#login").css('display', "none");
              $("#contact_info_load").remove();
          },
          error: function (data) {
              console.log("nie autoryzowano");
              $("#login_error").css("display", "block");
              $("#password").val('');
              $("#username").val('');
              $("#contact_info_load").remove();
          }
      });
  }
  </code></pre>
  
  <p>So i'am using Basic auth user input the domain adress when he want to login and get mob leads [information type] . Then input username and password and after that function send ajax call for url <a href="https://username:password@userdomain.com" rel="nofollow">https://username:password@userdomain.com</a>
  On debug true it is  work correctty but on debug false its returning  ajax error. In this moment i cant get the message error. If i get this message i will add it. Somebody knows why its crash on debug false ? </p>
  
  <p>My index.html head : </p>
  
  <pre><code>&lt;head&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;!--&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt;--&gt;
  
      &lt;!--fonts--&gt;
      &lt;link rel="stylesheet" type="text/css" href="hind-font.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="ubuntu-font.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="bootstrap.min.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="font-awesome.min.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="login_styles.css"&gt;
      &lt;script type='application/javascript' src='fastclick.js'&gt;&lt;/script&gt;
      &lt;script src="login.js"&gt;&lt;/script&gt;
      &lt;script src="jquery-2.2.0.js"&gt;&lt;/script&gt;
      &lt;script src="bootstrap.js"&gt;&lt;/script&gt;
  
      &lt;title&gt;Aplikacja Leadinfo&lt;/title&gt;
  
      &lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-2"&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>I try to use Content policy meta tag but its not working for me maybe i do some mistake. </p>
  
  <p>Today i get a ajax call error :
  status 0
  ready state 0
  responseText undefind </p>