我正在尝试使用ajax下载生成的pdf。到目前为止,我已经想出了这个,结果是空白PDF。我做错了吗?
$.ajax({
method: "POST",
url: "{{ url('survey/download') }}",
data: $('#frmSurveyDownload').serialize(),
})
.done(function( data ) {
var blob = new Blob([data], {type: "application/pdf"}),
url = window.URL.createObjectURL(blob);
window.open(url, "new window", "width=200, height=100");
window.URL.revokeObjectURL(url);
});