Chrome browser doesn't allow images to be placed on a HTML canvas?
trying to insert an image onto my canvas so I can use it as a sprite for a game. Here is what I have so far .......................html........................................ <!DOCTYPE html> <html> <head> <title>SPACE</title> <link rel="stylesheet" href="space.css"> </head> <body> <canvas id="myCanvas" width="1800" height="900"> <img src="Rocket.png" id="ship"/> </canvas> <script src="space.js"> </body> </html> ..........................................CSS................................... canvas{ background-color:#eee; } .......................................JavaScript...................................... var canvas = document.getElementById("myCanvas"); var img=document.getElementById("ship"); var ctx = canvas.getContext("2d"); function draw(){ ctx.clearRect(0,0,canvas.width,canvas.height); ctx.drawImage(img,10,10,120,141); }; setInterval(draw,10);