6 ms·
Even without JS, there are tricks to make the upvote button work without refreshing the page. HN used to do this, not sure if it still does.
by kccqzy 9y ago
Even without JS, there are tricks to make the upvote button work without refreshing the page. HN used to do this, not sure if it still does.
- SquareWheel 9y agoDo you have a reference to any of those tricks? Sounds interesting.
- framp 9y agoYou could use a link with a background-image <style>.vote-42:active{ background-image: url(/api/vote/42) } </style> <a class="vote-42">Vote</a>
- SquareWheel 9y agoI ran a quick test. That actually seems to work, at least in Chrome. Very cool! https://codepen.io/anon/pen/weMwRz https://codepen.io/anon/pen/weMwRz Realistically, I'd probably never use it because it's so dependent on browser behavior, but still a cool alternative.