I am having trouble loading an image from a url in javascript. The code below works, but I don't want to have to have the image loaded from html. I want to load the image from a url using pure javascript.
var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var img = document.getElementById("imImageId"); ctx.drawImage(img, 0, 0);