小编use*_*943的帖子

超出我想象的简单画布

    <html>
<head>
<script>
  function draw() {
    var canvas = document.getElementById('draw');
    if (canvas.getContext) {
      var ctx = canvas.getContext('2d');
      for (i=0,i<=700,i+=10){
      ctx.beginPath();
      ctx.moveTo(i,700-i);
      ctx.lineTo(700-i,i);
      ctx.stroke();
      }
    } else {
      document.write("Hey idiot, whhich idiot browser you are using? No IE clan here!");
    }
  }
</script> 
</head>
<body onload="draw();"> 
<canvas id="draw" width="700" height="700"></canvas>
</body></html>
Run Code Online (Sandbox Code Playgroud)

谁能告诉我这个简单的代码不起作用的问题是什么?................................

html javascript html5-canvas

-3
推荐指数
1
解决办法
49
查看次数

标签 统计

html ×1

html5-canvas ×1

javascript ×1