今天在使用html2canvas生成海报的时候,发现报了个如下图所示的错误:

发生这个错误的本质原因是在调用html2canvas的时候传递的是jQuery对象,而不是DOM原生对象

开始的时候我是按下图这么写的:

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

解决方法来自于:https://stackoverflow.com/questions/16396074/object-htmldivelement-as-jquery-object

Uncaught (in promise) Provided element is not within a Document的更多相关文章

  1. jQuery配合html2canvas 使用时 报错 Uncaught (in promise) Provided element is not within a Document

    报错代码: 这个函数运行时 function download(){ var element = $("#demo"); //jquery 获取元素 //这里将会报错 html2c ...

  2. Ionic3报错Error: Uncaught (in promise): Error: StaticInjectorError

    ERROR Error: Uncaught (in promise): Error: StaticInjectorError[Geolocation]: StaticInjectorError[Geo ...

  3. 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 ...

  4. 音频播放时出现 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 ...

  5. Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

    最近在开发一个网站时,有个需要是 如果有新预警信息要在网页中播放提示音.页面打开会请求是否有新信息,有则播放提示音.在Chrome的最新浏览器中,播放会报错,控制台显示Uncaught (in pro ...

  6. axios请求报Uncaught (in promise) Error: Request failed with status code 404

    使用axios处理请求时,出现的问题解决 当url是远程接口链接时,会报404的错误: Uncaught (in promise) Error: Request failed with status ...

  7. Uncaught (in promise)

    Uncaught (in promise) 使用es6的promise时候,有时候会出现如下错误: 这是因为,使用定义promise方法的时候,reject了,但是,在使用的地方没有用catch进行接 ...

  8. vue报错 Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法

    在进行跳转的时候报错 app.js:87499 Uncaught (in promise) NavigationDuplicated?{_name: "NavigationDuplicate ...

  9. 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 ...

随机推荐

  1. VMWare安装Linux系统之CentOS-6.6操作方法。

    1.使用VMWare创建新的虚拟主机 2.使用VMWare安装Linux,点击“开启虚拟主机” 3.进入Linux安装界面,选择第一项"Install or upgrade an exist ...

  2. Hadoop Streaming

    原文地址:http://hadoop.apache.org/docs/r1.0.4/cn/streaming.html Hadoop Streaming Streaming工作原理 将文件打包到提交的 ...

  3. Python学习笔记015——readline与readlines的区别

    示例1 读取同样一个文件binary_read_1.txt. 春眠不觉晓,处处闻啼鸟. 夜来风雨声,花落知多少. 其中该文件内容被下段代码读出(注意,这里是采用的readlines) f = open ...

  4. Android中asset文件夹和raw文件夹区别(转载)

    原文地址:http://www.cnblogs.com/leizhenzi/archive/2011/10/18/2216428.html *res/raw和assets的相同点: 1.两者目录下的文 ...

  5. AVL平衡二叉搜索树原理及各项操作编程实现

    C语言版 #include<stdio.h> #include "fatal.h" struct AvlNode; typedef struct AvlNode *Po ...

  6. HTML - 隐藏滚动条但可以滚动

    代码:(原理就是遮盖) 1.如果你把子div的140px宽度移除,你就明白其中的奥妙了. 2.原理就是父元素负责滚动,子元素负责遮盖. <html> <style> .scro ...

  7. object-c 获得目录(包括子目录)下所有文件和文件夹路径

    void getAllPathNameInDirectory(vector<string>&filePathList,vector<string>&direct ...

  8. 学习笔记之gethostbyname函数

    我们现在认知一台计算机主机通常采用直观可读的名字.例如博客园我们会记住 www.cnblogs.com 而不是记住42.121.252.58这个IP.对于大多数的应用程序来说应该是处理名字而不是处理地 ...

  9. 百度Android在线语音识别SDK用法

    百度Android语音识别SDK分在线与离线两种,这篇文章介绍在线SDK的用法. 在线SDK是以JAR包和动态链接库形式公布和使用,能够从百度开放云平台站点中下载SDK及使用说明文档. title=d ...

  10. maven(4)------maven核心pom.xml文件常用元素分析

    在maven项目中,pom文件是核心文件 pom.xml: <?xml version="1.0" encoding="UTF-8"?> <p ...