/***************************************************************************** Uncaught TypeError: this.canvas.getContext is not a function* 說明:* 使用Gauge.js的遇到這個問題,之前夢真使用的時候直接用div就OK的,目前* 還不知道為什么這里要用canvas來做才行。** 2017-3-9 深圳 南山平山村 曾劍鋒***************************************************************************/一、參考文檔:1. 報錯 Uncaught TypeError: c.getContext is not a functionhttps://zhidao.baidu.com/question/434893944652253124.html 二、報錯現象:Uncaught TypeError: this.canvas.getContext is not a functionat new b (gauge.min.js:1)at HTMLDocument.<anonymous> (soc.js:22)at i (jquery.min.js:2)at Object.fireWith [as resolveWith] (jquery.min.js:2)at Function.ready (jquery.min.js:2)at HTMLDocument.J (jquery.min.js:2)三、解決辦法:1. 原因:用的是div標簽不是canvas標簽;2. 修改: <div id="cpu"></div>為:<canvas id="cpu"></canvas>
?