<!DOCTYPE html> <html> <head> </head> <body> <canvas id="c" width="200" height="200"></canvas>s <script> var c = document.querySelector("#c"); var ctx = c.getContext("2d"); var image = new Image(); image.onload = function(){ console.log("Loaded image"); ctx.drawImage(image, 0, 0, c.width, c.height); } image.src = "fry_fixed.jpg"; </script> </body> </head> </html>