title: Parsing JSON in Phonegap simulator/iPhone vs. through browser
body: <p>I am working on an iPhone app using Phonegap with just JS/HTML5 on the front-end and .NET on the back-end. For the login I am just making a call to the web service and get JSON back. The problem I am having is when debugging this in the desktop browser vs. debugging it on the actual phone/simulator.</p>
  
  <p>The JSON that is retrieved looks like this when there is a valid login:</p>
  
  <pre><code>{"AuthToken":null,"Errors":[],"Success":true,"Message":null,"IsValid":true}
  </code></pre>
  
  <p>So I have this Ajax <code>success</code> function (jQuery):</p>
  
  <pre><code>success: function (data) {
      //this works on phone, but not in browser
      var success = data.Success;  //returns true             
      //this works in browser, but errors out on phone
      var dta = JSON.parse(data);
     success = dta.Success //returns true;
  }
  </code></pre>
  
  <p>Any idea why this might happen or how I can correct it?  It's just easier for me to debug in the browser using Firebug instead of always using the simulator. I have been using some other debug methods (Weinre for one) but none are as good as using Firebug.</p>