能帮忙看看,哪里有问题啊,为什么没有效果呢,还是默认的大小
<body>
<canvas id="canvas" style="border:1px solid grey;display:block;margin:50px auto"></canvas>
<script>
window.onload=function(){
var canvas=Document.getElementById('canvas');
canvas.width=1024;
canvas.height=768;
if(canvas.getContext('2d')){
var context=canvas.getContext('2d')
//开始绘图
}
else{
alert("请更换浏览器");
}
}
</script>
</body>