title: API request not working while debugging using phonegap but works in emulator, why?
body: <p>I have an issue with my mobile application that I'm building using phonegap. I will be connecting this app to Magento and fetch products' details and display in the app. 
  Oauth is configured for this url i.e.
  <code>http://localhost/Basava/api/rest/products</code> it gives me the json output if I type this url in address bar.</p>
  
  <p>Now I've written an ajax query in my app to request the same url to fetch json that I'll use to display images in the app. </p>
  
  <pre><code>     &lt;script type="text/javascript"&gt;
      function imageLoad() { 
          $.ajax({ 
          type: 'GET', 
          url: 'http://localhost/Basava/api/rest/products', 
          data: { get_param: 'value' }, 
          dataType: 'json',
          success: function (data) { 
          alert('success');
          ....
          ..
          }, 
          error: function() {
          alert('error');
          }
          });
          }
     &lt;script&gt;
     &lt;/head&gt; &lt;body onload="imageupload()"&gt;
     &lt;div id="afui"&gt;
      ...`
  </code></pre>
  
  <p>I've removed the logic in the <code>success</code> function and <code>&lt;body&gt;</code> since that is not part of my  problem.  Since I'm developing it in phonegap environment, I tested it using intel xdk.<br>
  case 1: While using the debug tab in intel xdk I get the error alert.<br>
  case 2: Using the app emulator in intel xdk I get success alert.<br>
  case 3: Opening the app in my browser gives the error alert.  </p>
  
  <p>Now I cannot understand these. Can anyone please explain this? What I'm doing wrong? I want to be able to load the app page in browser for debug purposes.</p>
  
  <p>Edit: Even if I change the error handler to look like this<br>
   <code>alert: function(jqXHR, textStatus) {
  alert(textStatus);
  }</code></p>
  
  <p>I just get an alert box, which displays nothing but plain <code>error</code> written on it.</p>