title: jQuery $.post fires multiple times when file >37,146 lines
body: <p>I am trying to send the entire rendered DOM back to my web server so that I can use it to create a PDF using PrinceXML. (Their internal js rendering engine doesn't support everything need for D3, so it's easier to pre-render tho js using Chrome and then send Prince the computed DOM.)</p>
  
  <p>This works fine until until the HTML file hits 37,147 lines. When this happens I the AJAX request fires 6 times instead of once, but the value of 'code' being sent to the server is null in each case. If I log 'content' to Chrome, I can see that it still logs correctly so it doesn't like like the XML serializer is what's failing. This is happening in Chrome 39 on OS X, with jQuery 1.11.1. Any idea what's happening? Again it works fine when the file is 37,146 lines long, but as soon as I add one extra // to the next line the whole thing blows up.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;
    $(document).ready(function() {
      var content = (new XMLSerializer()).serializeToString(document);
      $.post("report/scrape", {
        code: content
      });
    });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>