title: jQuery JSONP parsererror. Get returned data
body: <p>Please consider the following JavaScript</p>
  
  <pre class="lang-js prettyprint-override"><code>$.ajax({
      url: 'http://www.example.com/jsfunc/mycallback',
      cache: true,
      dataType: 'jsonp',
      jsonp: false, // defined by jsfunc/ argument
      jsonpCallback: "mycallback",
      timeout: 10000,
      error: function(jqXHR, textStatus, errorThrown) {
          window.console.log('JSONP Error: ' + textStatus + ' ' + errorThrown);
      },
      complete: function(jqXHR, textStatus) {
          window.console.log('JSONP was retrieved successfully');
      }
  });
  
  window.mycallback = function(data) {
      window.console.log('Callback with ' + data);
  }
  </code></pre>
  
  <p>In standard operation the URL is requested, mycallback hit and the complete function run.</p>
  
  <p>The problem I have is on occasion the URL returns data that triggers the error <strong>parsererror mycallback was not called</strong>. I'd like to log the data that is returned, obviously this data does not contain mycallback({[...]}) as the callback has not been triggered. As the situation only occurs on occasion under heavy load and I don't know what the data is the service is returning I'd like to log it so I can debug it.</p>
  
  <p>I've looked at jqXHR.responseText and jqXHR.responseXML and both these are empty.</p>
  
  <p>If the data returned by a jQuery JSONP request doesn't call the callback how can it be retrieved?</p>
  
  <p>Many thanks in advance,<br />
  Pete</p>