4 ms·
We wrote a library for storing application state in the URL. Its novel feature is using fragment query, which prevents the information from being sent to the s
by Zamicol 4y ago
We wrote a library for storing application state in the URL. Its novel feature is using fragment query, which prevents the information from being sent to the server.
https://github.com/Cyphrme/URLFormJS https://github.com/Cyphrme/URLFormJS
I would love to see it get more use.
Here's a small demo: https://cyphrme.github.io/URLFormJS/#?first_name=Bob&last_name=Smith&email_address=bob@something.com&phone_number=1234567890&subscribe_latest_news=true&country_select=1:~:text=Bob https://cyphrme.github.io/URLFormJS/#?first_name=Bob&last_na...
See my other comment on this page for some other examples of its use.
- notRobot 4y agoThis looks very cool, and I'll definitely use it in a side project sometime soon!
- lelandfe 4y agoDoes this necessarily prevent the ability to provide in-page anchors?
- vbezhenar 4y agoSince you're using JavaScript, you can implement anchors in the way you want.
- Zamicol 4y agoThe fragment query delimiter is `?` with `&` for between values, just like normal queries. It practice, browsers are not fragment delimiter aware so at the moment I would treat them as mutually exclusive. There's a larger issue of URL fragment delimiters. For a practical work around on Chrome only, fragment directive/text fragment can be used as a delimiter. (In my opinion, Chrome's delimiter should be re-worked with a new, more comprehensive delimiter.) Example of the workaround: https://en.wikipedia.org/wiki/URI_fragment#References:~:text=Bob?bob=bob https://en.wikipedia.org/wiki/URI_fragment#References:~:text...