window.onload=function(){
contents = new Array();
painted = new Array();
keys = 0;
for(var i = 0; i < 4; i++){
contents[i] = '';
painted[i] = false;
}
contents[0] = 1;
}
function clicked(canvasNumber){
if(contents[canvasNumber-1] == 1;){
alert("you won!");
}
}
我试图让一个弹出窗口说,“你赢了!” 单击画布 1 时,但我的内容数组的内容不匹配以触发该警报。我究竟做错了什么?