代码:<!DOCTYPE html><html><head> <title>canvas元素示例</title> <meta charset="utf-8"> <script type="text/javascript"> function draw(){ var canvas = document.getElementById('canvas'); if (canvas.getContext) { var context = canvas.getContext('2d'); var path1 = new Path2D(); path1.rect(10,10,100,100); var path2 = new Path2D(); path2.moveTo(220,60); path2.arc(170,60,50,0,2*Math.PI,false); path2.addPath(path1); context.stroke(path2); }} </script></head><body onload="draw()"> <h1>canvas元素示例</h1> <canvas id="canvas" width="400" height="300"></canvas></body></html>然后chrome提示:我这看蒙了也没看出来哪里写错了,求救~
1 回答
一只甜甜圈
TA贡献1836条经验 获得超5个赞
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 未实现 | 34 (34) | 未实现 | (Yes) | (Yes) |
添加回答
举报
0/150
提交
取消