J.Kirchartz Web Yinzer

Simple HTML5 notepad

Here’s a little html5 notepad using localStorage. Check it out

Lines 28 & 30 handle saving and retrieving the localStorage data, It’s supported on ie8+ as well as all modern browsers. Works on Android & iPhone too. Lines 32-34 call the save function in 3 different ways to ensure your information is saved automagically (I get a little paranoid like that) Line 5 & lines 20-23 ensure this works on older browsers, but we don’t really need most of it so really we could minimize this down to

Which is short enough to be in bookmarklet territory, unfortunately localStorage doesn’t work with the local file protocol, the spec says it needs a scheme/host/port to work for security reasons.

Local storage is just too easy NOT to use.

p.s. for further reading along these lines, check out (“World’s Smallest Office Suite”](https://zserge.com/posts/awfice/)