title: jQuery ajax and append - content too large?
body: <p>I am writing an ajax search page that contains a search box and "tabs"; the idea is that a user enters a query, changes the tab, the query is submitted with new options, and results loaded below.</p>
  
  <p>I am having a weird issue where the length(?) of the data ('content') returned seems to stop me running any extra JS.</p>
  
  <p>See below, #resultsArea is designed to have several sets of results in it as a user flicks between tabs so it'll show cached results if the query is the same rather than sending another unnecessary db query.</p>
  
  <p>"Content" is the data returned - and it seems as soon as I use this (whether it be in an alert, or printed on the page), I cannot execute any more javascript. If I remove +content+ from the .append function, the alert following the line will fire. Is this by design?</p>
  
  <p>"Content" contains quite a large quantity of data - loads of  s and formatting, so I wonder if this is the issue. However this all works and displays OK as it is! I just want to add some extra JS so I can load adverts into the rendered results, but this is stumping me.</p>
  
  <pre><code>$.ajax({
  type: 'POST',
  url: formUrl,
  data: formData,
  dataType: 'html',
  success: function(content) {
      $('#resultsBit').slideUp(200);
  
      if (query!=prevQuery)
          {   
              $('#results_'+flavour).remove();
          }
  
      alert('I will fire');
  
      $('#resultsArea').append('&lt;div id="results_'+flavour+'" style="display:true;"&gt;'+content+'&lt;/div&gt;');
  
      alert('I will not fire');
  
      }
  });
  </code></pre>
  
  <p>Thanks in advance for any pointers.</p>