title: Problems with AJAX call and phonegap
body: <p>I am developing a webapp in javascript and then make it "native" with PhoneGap. In this application I need to export to PDF, and for that I use a PHP script via an AJAX call. In this PHP call, I send a large amount of information, including a huge table in html and two SVG strings, each representing a chart.</p>
  
  <p>This is my AJAX call in javascript :</p>
  
  <pre><code>  jQuery.ajax(
      {
        type:'POST',
        url: 'http://xxx.xxx.xxx.xxx/php/pdfexport.php?callback=?',
        data:
        {
          dataHeader: JSON.stringify( tableHeaderEl ), //First table (Small)
          dataBody: JSON.stringify( tableBodyEl ), // Second table (Large)
          graphBar : JSON.stringify( svgBar ), // First chart (Large SVG)
          graphPie : JSON.stringify( svgPie ) // Second chart (Large SVG)
        },
        dataType: "json",
        success :
          function( result )
          {
            alert( 'Ok' );
          }
      }
    ).error(
      function( a, b, c )
      {
        alert( 'Error exporting PDF!' );
      }
    );
  </code></pre>
  
  <p>In PHP I dump the data received in a log file with the following code</p>
  
  <pre><code>&lt;?php
    $log = fopen( 'temp\\log.txt', 'a' );  
    ob_start();
    var_dump ($_REQUEST);
    $data = ob_get_clean();
    fwrite($log, $data);
    fclose($log);
    $result = array
    (
      "success" =&gt; true,
    );
    echo $_REQUEST['callback'] . "(" . json_encode($result) . ")";
  ?&gt;
  </code></pre>
  
  <p>With the application running directly in Safari I see the log with all the information sent, but from within the application created with PhoneGap, if a sent only the first table I see that the information is dumped, but if I send all the 4 strings, then nothing happens. No error also seems to be generated because the error function is not called.
  I have looked for some response to someone with such a problem, but could not find anything.</p>
  
  <p>Has anyone encountered such a problem? </p>
  
  <p>I'm using xcode 4, PhoneGap 1.5 and jQuery 1.7.1.</p>
  
  <p>Thanks in advance</p>