News for hackers. Stuff that matters.
Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @04:57PM (#20854839)
No, voting doesn't work at all with JS disabled.
Re:Tell HN: Thank you for not redesigning Hacker News by icebraining on Sunday September 01, 2019 @05:18PM (#20854980)
Yes, it does. I think you have something weird with your browser: with JS on, it does a light AJAX request, without it, it does the whole redirect thing.
Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Sunday September 01, 2019 @06:10PM (#20855322)
The request is the same. The buttons are <a> tags. Without JS, the link is clicked and does a full page reload. With JS, the click is caught and sent as a AJAX request where the response is ignored.

It's not any lighter, it's just not reloading the page.

Re:Tell HN: Thank you for not redesigning Hacker News by oplav on Sunday September 01, 2019 @05:37PM (#20855113)
https://i.imgur.com/9z2VAfa.png

These are my network requests when I vote with JS enabled.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @06:39PM (#20855481)
Whoops, you're right, it does work either way. The response is the same with or without JS though, it just doesn't do anything with it when JS is enabled (because as a hacky way of doing "AJAX" it sets the voting url as the src value of an <img> tag that doesn't actually get displayed).
Re:Tell HN: Thank you for not redesigning Hacker News by cynwoody on Sunday September 01, 2019 @11:39PM (#20856617)
Voting does work with JS disabled, just not well.

The page reloads and re-renders with the UI changes (up-down buttons hidden and unvote link added). However, the reload takes noticeable time, and you lose your scroll location, which is disorienting.

With JS enabled, the UI changes happen instantly, and the scroll position doesn't change. The page still reloads, but the reload is directed into a new Image object which is immediately garbage, so it's off the UI timeline. But it's inexplicable bandwidth waste, nonetheless!