为什么只有画布 显示不出直线?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas id="canvas" width="1024" height="768" style="border:1px solid #aaa;display:block;margin:50px auto;"></canvas>
<script>
windows.onload=function(){
var canvas=document.getElementById("canvas");
var context = canvas.getContext("2d");
//使用context绘制
context.moveTo(100,100);
context.lineTo(700,700);
context.stroke();
}
</script>
</body>
</html>