【问题标题】:jspdf Expected : error for get widthjspdf预期:获取宽度错误
【发布时间】:2015-11-24 14:07:07
【问题描述】:

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

即将发生的错误:

预期的“:” 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 链接中可以找到相同的代码。 CDN链接如下: https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.1.135/jspdf.debug.js

提前致谢!!!!

【问题讨论】:

    标签: javascript jquery jspdf canvasjs


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-06
      • 2019-04-21
      • 1970-01-01
      • 1970-01-01
      • 2014-08-23
      • 1970-01-01
      • 2021-04-25
      • 1970-01-01
      相关资源
      最近更新 更多