Uncaught TypeError: this.canvas.getContext is not a function
/****************************************************************************
* Uncaught TypeError: this.canvas.getContext is not a function
* 说明:
* 使用Gauge.js的遇到这个问题,之前梦真使用的时候直接用div就OK的,目前
* 还不知道为什么这里要用canvas来做才行。
*
* 2017-3-9 深圳 南山平山村 曾剑锋
***************************************************************************/ 一、参考文档:
. 报错 Uncaught TypeError: c.getContext is not a function
https://zhidao.baidu.com/question/434893944652253124.html 二、报错现象:
Uncaught TypeError: this.canvas.getContext is not a function
at new b (gauge.min.js:)
at HTMLDocument.<anonymous> (soc.js:)
at i (jquery.min.js:)
at Object.fireWith [as resolveWith] (jquery.min.js:)
at Function.ready (jquery.min.js:)
at HTMLDocument.J (jquery.min.js:) 三、解决办法:
. 原因:用的是div标签不是canvas标签;
. 修改:
<div id="cpu">
</div>
为:
<canvas id="cpu">
</canvas>
Uncaught TypeError: this.canvas.getContext is not a function的更多相关文章
- Uncaught TypeError: _react2.default.findDOMNode is not a function
react 查找某节点时报错 Uncaught TypeError: _react2.default.findDOMNode is not a function 代码: import React, { ...
- Uncaught TypeError: jQuery.i18n.browserLang is not a function
/********************************************************************* * Uncaught TypeError: jQuery. ...
- Uncaught TypeError: _react2.default.createContext is not a function
question is caused by react version, update your react version, it will be ok. use "npm update ...
- js Object扩展自定义方法,jQuery抛出 Uncaught TypeError: matchExpr[type].exec is not a function
使用Jquery的时候,想在Object原型上添加自己扩展的方法的时候,启动项目之后,打开网页就会报如上错误信息,经过测试,可以在Object下的具体类型上进行扩展自定义方法,如String,Arra ...
- Uncaught TypeError: Cannot read property 'msie' of undefined
因为图方便,抄了别人写的一个jquerry插件,运行时“var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ...
- 360浏览器Uncaught TypeError: object is not a function问题
刚刚360浏览器提示 Uncaught TypeError: object is not a function,找了半天发现问题是我有一个按钮,id和方法重复了,所以提示这个. <input t ...
- Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || e.handler).apply is not a function
页面中出现了Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || ...
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
我们开发的产品,有一部分功能,需要在WebView中打开web页面,然后在web页面中通过js方法回调部分native的功能. 对于web回调native的开发方式,如果不了解的话,可以参考我以前的一 ...
- jQuery-2.1.4.min.js:4 Uncaught TypeError: Illegal invocation
jQuery-2.1.4.min.js:4 Uncaught TypeError: Illegal invocation 此错误与crsf有关
随机推荐
- Overload and Override without Overwrite - Java
Override(覆盖/覆写): 子类Override父类中的函数(方法).Overload(重载): 同一个类中包含多个同名的函数(方法), 但各个函数的参数列表不同. Override和Overl ...
- Linux 路径与命令搜寻顺序
以相对/绝对路径运行命令,例如『 /bin/ls 』或『 ./ls 』: 由 alias 找到该命令来运行: 由 bash 内建的 (builtin) 命令来运行: 透过 $PATH 这个变量的顺序搜 ...
- 最小化CentOS6.7(64bit)---安装mysql5.5、jdk、tomcat
********mysql******** ------------------------------------------------------------------------------ ...
- mongodb简单用法
修改器: $inc: 增加已有的键值,如果键值不存在就创建一个 数据库中存在这样的数据:{ , "url": "www.example.com", }db.fz ...
- Android 使用OpenCV的三种方式(Android Studio)
http://blog.csdn.net/sbsujjbcy/article/details/49520791 其实最早接触OpenCV是很久很久之前的事了,大概在2013年的5,6月份,当时还是个菜 ...
- winter 2018 02 01 关于模运算的一道题
题目:给出一个正整数n,问是否存在x,满足条件2^x mod n=1,如果存在,求出x的最小值. 分析:1.若给出的n是1,则肯定不存在这样的x; 2.若给出的是偶数,2的次幂取余一个偶数得到 ...
- iOS下的WiFi开发
iOS下Wi-Fi开发需要添加依赖库SystemConfiguration.framework,在需要使用Wi-Fi信息的控制器下引入头文件#import <SystemConfiguratio ...
- Java final static关键字
Java中的final关键字 使用 final 关键字做标识有 “最终的” 含义. final 可以修饰 类.方法.属性.变量 final 修饰类: 则该类不允许被继承 final 修饰方法:则该方法 ...
- ubuntu centos macos 配置上网代理
因为我国强大的GFW,导致很多国外的应用无法安装,因为需要在系统中配置http/https代理. Ubuntu代理配置 配置方式非常简单,在~/.bashrc文件中增加: echo "exp ...
- maven deploy 代码
Run As --> Run Configurations ---> Maven Build --->New _Configuration(双击Maven Build可生成) --& ...