今天在使用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. HDFS权限管理用户指南

    原文地址:http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_permissions_guide.html 概述 用户身份 理解系统的实现 文件系统API变更 S ...

  2. Python学习笔记015——文件file的常规操作之四(输入重定向)

    windows命令提示符(cmd.exe)和Linux Shell(bash等)均可通过">"或”>>“将输出重定向.其中, ">"表示 ...

  3. ulbuntu 安装配置 java

    一.下载JDK        下载地址: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151 ...

  4. Python2 字典 cmp() 函数

    描述 Python 字典的 cmp() 函数用于比较两个字典元素,如果 dict1 < dict2 返回 -1, 如果 dict1 == dict2 返回 0, 如果 dict1 > di ...

  5. CheckedComboBoxEditExtension

    public static class CheckedComboBoxEditExtension { public static void BindData(this CheckedComboBoxE ...

  6. vue开发环境搭建win10

    需要安装nodejs, webpack@2.2.1, babel-cli,  vue-cli 1 安装nodejs 现在版本默认会安装nodejs 和 npm包 和 配置环境 2 检查是否安装成功,在 ...

  7. 关于K8s集群器日志收集的总结

    本文介绍了kubernetes官方提供的日志收集方法,并介绍了Fluentd日志收集器并与其他产品做了比较.最后介绍了好雨云帮如何对k8s进行改造并使用ZeroMQ以消息的形式将日志传输到统一的日志处 ...

  8. Javac编译器

    One Compiler http://www.oracle.com/technetwork/java/jvmls2016-wimmer-3125555.pdf Hacking the OpenJDK ...

  9. The Ultimate List of Open Source Static Code Analysis Security Tools

    https://www.checkmarx.com/2014/11/13/the-ultimate-list-of-open-source-static-code-analysis-security- ...

  10. 每日英语:He Diets, She Diets: More Weight-Loss Plans Target Men

    Weight-loss companies are becoming savvier about getting men to go on a diet. savvier:更加精明 Men and w ...