实在是不知道哪错了。。。
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>绘制弧形和圆</title> </head> <body> <canvas id="canvas"style="border: 1px solid black;display: block;margin:50px auto;"> 如果您看到这句话,证明您的浏览器不支持canvas </canvas> <script> window.onload = function () { var canvas = document.getElementById('canvas'); canvas.width = 1024; canvas.height = 768; var context = canvas.getContext('2d'); context.lineWidth = 5; context.strokeStyle="blue"; context.arc = (300 , 300 , 200 , 0 , 1.5*Math.PI ); context.stroke() } </script> </body> </html>
怎么就是显示不出来呢,跟着老师一起敲的呀。。。