Uncaught (in promise) Provided element is not within a Document
今天在使用html2canvas生成海报的时候,发现报了个如下图所示的错误:

发生这个错误的本质原因是在调用html2canvas的时候传递的是jQuery对象,而不是DOM原生对象。
开始的时候我是按下图这么写的:

改成如下图所示的就可以了:

解决方法来自于:https://stackoverflow.com/questions/16396074/object-htmldivelement-as-jquery-object
Uncaught (in promise) Provided element is not within a Document的更多相关文章
- jQuery配合html2canvas 使用时 报错 Uncaught (in promise) Provided element is not within a Document
报错代码: 这个函数运行时 function download(){ var element = $("#demo"); //jquery 获取元素 //这里将会报错 html2c ...
- Ionic3报错Error: Uncaught (in promise): Error: StaticInjectorError
ERROR Error: Uncaught (in promise): Error: StaticInjectorError[Geolocation]: StaticInjectorError[Geo ...
- Atitit Uncaught (in promise) SyntaxError Unexpected token < in JSON at position 0
Atitit Uncaught (in promise) SyntaxError Unexpected token < in JSON at position 0 Uncaught (in ...
- 音频播放时出现 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
<audio id="play" controls="controls" loop="loop"> <source src ...
- Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
最近在开发一个网站时,有个需要是 如果有新预警信息要在网页中播放提示音.页面打开会请求是否有新信息,有则播放提示音.在Chrome的最新浏览器中,播放会报错,控制台显示Uncaught (in pro ...
- axios请求报Uncaught (in promise) Error: Request failed with status code 404
使用axios处理请求时,出现的问题解决 当url是远程接口链接时,会报404的错误: Uncaught (in promise) Error: Request failed with status ...
- Uncaught (in promise)
Uncaught (in promise) 使用es6的promise时候,有时候会出现如下错误: 这是因为,使用定义promise方法的时候,reject了,但是,在使用的地方没有用catch进行接 ...
- vue报错 Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法
在进行跳转的时候报错 app.js:87499 Uncaught (in promise) NavigationDuplicated?{_name: "NavigationDuplicate ...
- patchUpload.vue?5e29:406 Uncaught (in promise) DOMException: Failed to execute 'readAsArrayBuffer' on 'FileReader': The object is already busy reading Blobs.
patchUpload.vue?5e29:406 Uncaught (in promise) DOMException: Failed to execute 'readAsArrayBuffer' o ...
随机推荐
- RabbitMQ消息队列(二):"Hello, World"[转]
2. Sending 第一个program send.cs:发送Hello world 到queue.正如我们在上篇文章提到的,你程序的第9行就是建立连接,第12行就是创建channel,第14行创建 ...
- 方法$.data()和$.('#test').on()的使用
1.on() 方法的使用 在选择元素上绑定一个或多个事件的事件处理函数. on()方法绑定事件处理程序到当前选定的jQuery对象中的元素.在jQuery 1.7中,.on()方法 提供绑定事件处理程 ...
- SQL SERVER 2005允许自定义聚合函数-表中字符串分组连接
不多说了,说明后面是完整的代码,用来将字符串型的字段的各行的值拼成一个大字符串,也就是通常所说的Concat 例如有如下表dict ID NAME CATEGORY 1 RED COLOR ...
- 打开u盘时提示是否要将其格式化的提示
早上打开电脑插入U盘后,发现U盘报以下错误:(心中一紧,昨晚写的文档还在其中呢) 修复方法: Win+R 输入cmd 打开 ,执行命令 chkdsk G: /f 其中G为损坏区域所在盘符,即U盘在电脑 ...
- zabbix客户端安装和配置(windows)
下载相应版本客户端软件 zabbix_agents_2.4.4.win.zip 安装步骤 解压 1.如果是64位系统,则把\bin\win64\下面的三个文件拷贝到c:\zabbix目录下:如果是32 ...
- Clojure 的 Enlive 库尝试
Enlive 是一个 Clojure 下的 html 模板引擎.其特别之处在于,它既没有发明任何 html 内嵌的模板 DSL 语法:也不会混杂代码和表现. 一切的一切,都是按下列模型定义的次序执行的 ...
- Common Probability Distributions
Common Probability Distributions Probability Distribution A probability distribution describes the p ...
- Linux下修改时间时区的方法介绍
点评:在Linux中,用于时钟查看和设置的命令主要有date.hwclock和clock.其中,clock和 hwclock用法相近,只不过clock命令除了支持x86硬件体系外,还支持Alpha硬件 ...
- U3D正播反播动画剪辑
正播就是直接play item.animation.Play("a"); 反播: item.animation.Play("a"); item.animatio ...
- MYSQL COST optimizer
http://blog.chinaunix.net/uid-26896862-id-3326400.html https://www.slideshare.net/olavsa/mysql-optim ...