HTML localstorage - saving images

Oscar Brito

var imgCanvas = $("canvas");
// Get canvas contents as a data URL
var imgAsDataURL = imgCanvas.toDataURL("image/png");

// Save image into localStorage
localStorage.setItem("elephant", imgAsDataURL);

Visit for more informations, contacts and news about Web Development.
See other blog posts at

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.

Feel free to contact divhide.