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 ...
随机推荐
- NuGet学习笔记(1) 初识NuGet及快速安装使用[转]
来自:http://www.cnblogs.com/lzrabbit/archive/2012/05/01/2477607.html 关于NuGet园子里已经有不少介绍及使用经验,本文仅作为自己研究学 ...
- printDocument设置适应边框打印 特重要 找了半天 设置一个属性即可
private void pd_PrintPage(object sender, PrintPageEventArgs e) { e.Graphics.SmoothingMode = System.D ...
- DataTime? 的 GetValueOrDefault() 方法
DataTime? 转换为 DataTime类型 就可以调用 ToString() 自定义格式 @item.CreateDate.GetValueOrDefault().ToString(" ...
- android studio 中出现"...ProjectScript\buildscript\cache.properties.lock"
Owner PID: unknownOur PID: 8496Owner Operation: unknownOur operation: Initialize cacheLock file: C ...
- RHEL7 -- NetworkManager
RHEL7中默认的网络服务是由NetworkManager提供,NetworkManager可以动态控制和配置网络. 网络工具和应用 应用或工具 描述 NetworkManager 默认的网络守护进程 ...
- Unix环境高级编程(十三)守护进程
守护进程也称为精灵进程是一种生存期较长的一种进程.它们独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件.他们常常在系统引导装入时启动,在系统关闭时终止.unix系统有很多守护进程,大多数 ...
- Concurrency Managed Workqueue(二)CMWQ概述
一.前言 一种新的机制出现的原因往往是为了解决实际的问题,虽然linux kernel中已经提供了workqueue的机制,那么为何还要引入cmwq呢?也就是说:旧的workqueue机制存在什么样的 ...
- scikit-learn 入门
简介: scikit-learn是一个基于NumPy.SciPy.Matplotlib的开源机器学习工具包.採用Python语言编写.主要涵盖分类. 回归和聚类等算法,比如knn.SVM.逻辑回归.朴 ...
- PHP Client for Mysql Binlog
PHP解析MySQL Binlog,依赖于mysql-replication-listener库 详见:https://github.com/bullsoft/php-binlog Install M ...
- unity c# script error CS0664: Literal of type double cannot be implicitly converted to type `float'. Add suffix `f' to create a literal of this type
例如在unity c# script中定义 private float x=0.0; 则会报 error CS0664: Literal of type double cannot be implic ...