I have the following jquery code for a button that works for the most part, but Im missing a step.
$('#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) {
}
});
});
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