jspdf 预期:获取宽度错误

jspdf Expected : error for get width

过去两天我一直面临这个问题,在 html 代码中为 "Expected :" 抛出错误。我基本上将 canvasjs 与 jspdf 一起使用,并且在加载页面时出现该错误。我用cdn替换了我的本地副本link以为问题会得到解决,但仍然没有解决

即将发生的错误:

应为“:” jspdf.debug.js, 第 1023 行字符 9

错误发生在 jspdf 的主文件中,因此我无法继续。下面的代码写了上面提到的行:

        'pageSize' : {
            get width() {            //<<<<<<this line is causing the error
                return pageWidth
            },
            get height() {           //<<<<<<I'm assuming this line will also causing an error
                return pageHeight
            }
        },

在 CDN link 上找到了相同的代码。 CDNlink如下: https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.1.135/jspdf.debug.js

提前致谢!!!

对于那些遇到过这个问题的人来说,这似乎是您使用的 IE 版本和 chrome 版本的问题。我使用的是不支持 JSPDF 的 IE 8,因此我在 IE 中遇到了该错误。同样的错误出现在 Chrome 版本:17.0.963.83。现在也更新了 Chrome。现在一切正常!