4 ms·
Ask HN: Why clicking on favorite takes you to favorites page?
It is kind of annoying. I just want to bookmark the post while I am reading comments no need to take me to different page.
- metadat 4y agoIt's because HN uses very little Javascript. So this is the way it works, a simple get request to an endpoint.
- Minor49er 4y agoI'm not on a computer to test this, but I wonder if it would be possible with the href attribute set to a fragment (#) and the ping attribute set to the URL where a favorite gets saved. I'm not sure if ping works without navigating to another page or not
- gus_massa 4y agoMy guess is it sends you to the favorite page so you are sure it has been saved there. I think it can be implemented differently, like the upvotes that are counted without a page change.
- metadat 4y agoI don't think the #-and-after portion gets submitted to the server. IIRC it's reserved exclusively for client-side use. When in doubt I suggest simply emailing our moderator, TheDang: hn@ycombinator.com. They are the ultimate arbiter of these matters.
- Minor49er 4y agoNo, the fragment wouldn't get sent to the server at all. The ping part would though
- alxmng 4y agoThe endpoint could redirect back to the same page.