mardi 23 décembre 2014

How to use dynamically created image in another html file?


So I've tried unsuccessfully to copy the src of a dynamically created image through javascript in my index.html file, and I would like to create a new image in another html page where the src from the original is copied over and display that image. Any input or suggestions would be appreciated. My condensed code is below.


From script on first page:



var img = new Image();
img.src = reader.result;
img.id = 'newimg';


From script on second page:



var image = document.getElementById('newimg');
var newimage = new Image();
newimage.id = 'ni';
newimage.src = image.src;




Aucun commentaire:

Enregistrer un commentaire