Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import/Export HTML5 localStorage data

I'm working on a simple TODO list app based on localStorage HTML5 feature:

http://hamen.github.com/webnotes/

I'm wondering if it's possible to import/export data in some way. How could I provide an "Export note/Import note" feature to make users being able to save their note on their HD and import them in another browser profile?

Thanks

like image 204
Ivan Morgillo Avatar asked May 16 '10 21:05

Ivan Morgillo


People also ask

Does HTML5 have local storage?

Because HTML5 local storage is natively integrated into Web browsers, it is available without third-party browser plug-ins. It is described in the HTML5 specifications. Local storage is mainly used to store and retrieve data in HTML pages from the same domain.

Can localStorage be hacked?

On the downside, localStorage is potentially vulnerable to cross-site scripting (XSS) attacks. If an attacker can inject malicious JavaScript into a webpage, they can steal an access token in localStorage. Also, unlike cookies, localStorage doesn't provide secure attributes that you can set to block attacks.

How does HTML display localStorage data?

“how to display local storage data in html” Code Answer's It's simple. Just go to the developer tools by pressing F12 , then go to the Application tab. In the Storage section expand Local Storage. After that, you'll see all your browser's local storage there.


1 Answers

I think you can use the "HTML File API" to load from file and a "Data URI" (http://en.wikipedia.org/wiki/Data_URI_scheme) to save.

like image 112
rpl Avatar answered Oct 16 '22 02:10

rpl