getContext();
can1 = document.getElementById("canvas1");
ctx1 = can1.getContext();
console.log(ctx1); ?//為什么輸出的是null , 導致后面也報錯Cannot read property ' ?' of null
can1 = document.getElementById("canvas1");
ctx1 = can1.getContext();
console.log(ctx1); ?//為什么輸出的是null , 導致后面也報錯Cannot read property ' ?' of null
2016-12-21
舉報
2017-03-14
要看你用的是什么編碼器,我用的是sublime text3是這樣的:
ctx1=can1.getcontext
不要括號和分號。希望能幫到你。
2017-03-02
單引號? 不是雙引號
2017-02-27
我也是這個問題
2016-12-21
ctx1 = can1.getContext("2d");