I use AJAX POST to submit form data to an external script and try to hide the form when submitting and ask the user to load the script.
The script itself works (uses fpdf to output a pdf file for download). For some reason, a user download request never comes.
My Ajax request currently:
$.ajax({ url: "file.php", type: "POST", data: data, cache: false, success: function (html) { //hide the form $('#form').fadeOut('slow'); //display results $('#form_results').fadeIn('slow'); $("#form_results").html(html); } });
file.php (by itself) will generate and display a PDF file using FPDF. By setting the output to I, the document will be output to the browser, setting it to "D", it will usually force download if I just accessed the .php file directly.
any ideas?
source share