How to capture one image and put it in localStorage?

How is this done, of course, without external libraries, in plain HTML with JavaScript? It seems to be a simple single line.

I would just like to:

<script> localStorage.image=src("http://"+randomflikrimage+".jpg") </script> 
+6
source share
1 answer

Try to save base64 data, use canvas. Check this out: Get image data in JavaScript?

+4
source

Source: https://habr.com/ru/post/888141/


All Articles