←back to thread

578 points smusamashah | 1 comments | | HN request time: 0.201s | source
Show context
egeozcan ◴[] No.42463511[source]
This is very cool. BTW, when developing single HTML file apps, instead of localStorage, one can use the HTML as the source of truth, so the user can just save/save-as to persist. I had mentioned my quick and dirty attempt at an image gallery that is a self-contained html file and some really liked the concept, if not the "app" itself: https://news.ycombinator.com/item?id=41877482
replies(6): >>42463631 #>>42464347 #>>42467577 #>>42471918 #>>42476577 #>>42477123 #
65 ◴[] No.42471918[source]
How would this work without manually editing the HTML file?
replies(1): >>42471980 #
1. egeozcan ◴[] No.42471980[source]
You write Javascript to read and write to HTML, like, develop a single page app that treats HTML as the view and the database, and restores state on DOMContentLoad from the HTML. Super easy and maintainable for micro apps.

You can also use the contenteditable attribute and use no JS, so you basically have a notepad.