Javascript pdfmake jquery插件浏览器弹出块
我正在使用一个jquery插件,它的名字是这样的。我能够创建我的需求的整个pdf,但当我请求浏览器打开pdf文件时,问题就出现了。浏览器没有打开pdf,而是说弹出窗口被阻止了。单击并选择允许从此站点弹出窗口后,将打开pdf。我的剧本:Javascript pdfmake jquery插件浏览器弹出块,javascript,jquery,pdf,browser,Javascript,Jquery,Pdf,Browser,我正在使用一个jquery插件,它的名字是这样的。我能够创建我的需求的整个pdf,但当我请求浏览器打开pdf文件时,问题就出现了。浏览器没有打开pdf,而是说弹出窗口被阻止了。单击并选择允许从此站点弹出窗口后,将打开pdf。我的剧本: <script> var docDefinition = { content: [ { text: 'BirdVision Invoice', style: 'header' }, { text: 'Bill
<script>
var docDefinition = {
content: [
{ text: 'BirdVision Invoice', style: 'header' },
{ text: 'Bill To', style: 'anotherStyle' },
{ text: '<?php echo $row->client_name; ?>', margin: [ 5, 0, 0, 0 ] },
{ text: '[Company Name]', margin: [ 5, 0, 0, 0 ] },
{ text: '[Street]', margin: [ 5, 0, 0, 0 ] },
{ text: '[POST/ORT]', margin: [ 5, 0, 0, 0 ] },
{ text: '[Phone/Email]', margin: [ 5, 0, 0, 0 ] },
{ text: 'Bill For', style: [ 'header', 'anotherStyle' ] },
{ text: 'Total :', alignment: 'right', margin: [ 5, 50, 100, 10], fontSize: 22, bold: true},
{ text: 'If you have any questions feel free to contact us!! ', alignment: 'center', margin: [ 0, 500, 0, 0]},
],
styles: {
header: {
fontSize: 22,
bold: true
},
anotherStyle: {
margin: [ 5, 50, 10, 10 ],
fontSize: 15,
bold: true,
italic: true,
alignment: 'left',
}
}
};
pdfMake.createPdf(docDefinition).open();
</script>
我弄明白了,很抱歉这个问题有歧义。由于系统自动生成请求,浏览器阻止打开pdf。因此,我创建了一个按钮来参与人机交互,如:
<button class = "btn btn-default" onclick="pdfMake.createPdf(docDefinition).open()"> Open PDF </button>
现在没有来自任何浏览器的弹出阻止消息。您的问题是什么?