title: Sending data using jquery .ajax to generate pdf file
body: <p>I have the following jquery code for a button that works for the most part, but Im missing a step.</p>
  
  <pre><code>$('#download').on('click', function(e) {
      var data = {
          header: $('#header').html(),
          title: $('#title').html(),
          table: $('#nfl').html(),
          rules: $('#rules').html(),
      };
  
      e.preventDefault();
  
      $.ajax({
          url: 'print',
          method: 'post',
          data: data,
          success: function(returnValue) {
  
  
          }
      });
  });
  </code></pre>
  
  <p>It sends data to the print url that will generate a pdf file that automatically downloads. I can see the code generating the pdf in firebug, but the download does not happen. I never really understood the success: parameter all that well. I think this is where I should edit to get it to work</p>