问答详情
源自:2-2 绘制直线、多边形和七巧板

为什么我写的js没反应呢

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Document</title>


</head>

<body>

<canvas id="canvas" width="1024" height="1080" style="border: 1px solid #aaa;display: block; margin: 50px auto; ">


</canvas>

<script>

window.onload = function(){

   var canvas = docunent.getElementById("canvas");

var context = canvas.getContext("2d");

context.moveTo(100,100);

context.lineTo(700,700);

context.stroke();


}

</script>

</body>

</html>


提问者:不含糖 2016-03-09 22:17

个回答

  • 轻风夜近人
    2016-03-10 13:47:56
    已采纳

    document写错了