我已经搜寻了很久但仍然没找到帮助。
我有两个文件:header.php
和other.php
。
我的header.php
看起来像这样:
<head>
.....
</head>
<header>
.....
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.min.js"></script>
</header>
我需要在other.php
文件中引入header.php
,并且想要在这个文件中使用jsPDF:
require "header.php";
<body>
....
</body>
<script>
function createInvoice(final){
const doc = new jsPDF();
doc.text("Hello world!", 10, 10);
doc.save("a4.pdf");
}
</script>
我尝试了将jsPDF脚本包含在标签、标签和带有函数的