error @ main.js:17game @ main.js:10
<code>
var can1;
var can2;
var ctx1;
var ctx2;
document.body.onload = game;
function game()
{
init();
}
function init()
{
//获得canvas context
can1 = document.getElementById("canvas1");//finshes,dust,UI,cirle
ctx1 = can1.getContext();
can2 = document.getElementById("canvas2");//background,ane,fruits
ctx2 = can2.getContext();
}
</code>
main.js:17 Uncaught TypeError: Failed to execute 'getContext' on 'HTMLCanvasElement': 1 argument required, but only 0 present.init
@ main.js:17game
@ main.js:10