小编vDr*_*ews的帖子

jsPDF通过脚本标签始终未定义

我已经搜索了很长时间,但没有任何帮助。我有两个文件 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>
Run Code Online (Sandbox Code Playgroud)

我需要header.phpinother.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>
Run Code Online (Sandbox Code Playgroud)

我尝试使用脚本将 jsPDF 包含在 body 标签、head 标签和带有函数的脚本标签中,但每次我都收到以下错误:

Uncaught ReferenceError: jsPDF is not defined
Run Code Online (Sandbox Code Playgroud)

有人能帮我吗?先感谢您

php undefined jspdf

6
推荐指数
1
解决办法
1863
查看次数

AWS SES send email lambda not sending every time

I want to send emails using the ses from aws from lambda. The problem is that the email is only sent some times using the same code. We don't get errors.

Here's the code:

const AWS = require('aws-sdk');
var ses = new AWS.SES();

exports.handler = async (event, context, callback) => {
  context.callbackWaitsForEmptyEventLoop = false;

    await new Promise((resolve, reject) => {

      var params = {
        Destination: {
            ToAddresses: [myEmail]
        },
        Message: {
            Body: {
                Text: { Data: "Test"

                }

            },

            Subject: …
Run Code Online (Sandbox Code Playgroud)

sendmail amazon-web-services amazon-ses aws-lambda

1
推荐指数
1
解决办法
1624
查看次数