4 ms·
> all the information is stored in the URL so no data leaks to the site Thanks, that's actually a nice feature. For anyone curious, it works because using an
by Terr_ 10y ago
> all the information is stored in the URL so no data leaks to the site
Thanks, that's actually a nice feature.
For anyone curious, it works because using an URL like http://example.com/page?foo=bar#secret http://example.com/page?foo=bar#secret in a browser will not actually send "secret" to the server, as per RFC 1808.
Of course, there's nothing stopping some sneaky JS that runs later from reading the data and sending it back through another channel, but that's another story.
- saycheese 10y agoFor more info on the anchor not being sent to the server see: http://stackoverflow.com/questions/3067491/is-the-anchor-part-of-a-url-being-sent-to-a-web-server http://stackoverflow.com/questions/3067491/is-the-anchor-par...
- photomultiply 10y agoI have implemented pages that circumvent that detail with AJAX. var hash = window.location.hash.substr(1); Then you just quietly: $.ajax( "example.php?hash=" + hash ); No one will ever notice the difference without inspecting their network traffic, and docile, agreeable users will gaze reassuringly at the anchor, and lull themselves to sleep, feeling placated by the presence of the warm glow of the # character in their address bar. Here, see for yourself: data:text/html,<script>alert(window.location.hash.substr(1))</script>#because+anchors+are+always+safe Paste that into your address bar, and witness the simplicity.
- digeridew 10y agoI have implemented pages that circumvent that detail with AJAX. var hash = window.location.hash.substr(1); Then you just quietly: $.ajax( "example.php?hash=" + hash ); No one will ever notice the difference without inspecting their network traffic, and docile, agreeable users will gaze reassuringly at the anchor, and lull themselves to sleep, feeling placated by the presence of the warm glow of the # character in their address bar. Here, see for yourself: data:text/html,<script>alert(window.location.hash.substr(1))</script>#because+anchors+are+always+safe Paste that into your address bar, and witness the simplicity.
- fao_ 10y ago> Of course, there's nothing stopping some sneaky JS that runs later from reading the data and sending it back through another channel, but that's another story. Already covered :P
- Terr_ 10y ago> No one will ever notice the difference without inspecting their network traffic, Which I did, when checking out the app. It's why I mentioned it as a possibility.