javascript - Drawing circles to canvas using functions -


    <div>          <canvas id="canvas" width="250px" height="400px" style="border: 1px solid black" onload="drawcircle()"></canvas>     </div>     <script type="text/javascript" src="canvasjs.js"></script> </body>  </html> 

var canv = document.getelementbyid("canvas"); var ctx = canv.getcontext("2d");  function drawcircle(){      ctx.fillstyle="blue";     ctx.beginpath();     ctx.arc(50,50,50,0,math.pi*2);     ctx.closepath();     ctx.fill(); } 

just wondering if can tell me why not draw canvas. if remove code function works.

you did not invoke function. please append code below codes;

drawcircle(); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -