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