3 ms·
I’ve never tried it, but my understanding is when JS is disabled HN fires off a GET request (via a link) and returns a 204 to prevent browser navigation, right?
by BizarreByte 4y ago
I’ve never tried it, but my understanding is when JS is disabled HN fires off a GET request (via a link) and returns a 204 to prevent browser navigation, right?
- boredtofears 4y agoInterestingly enough, although javascript gets used, the vote links don't trigger an XHR request - instead the javascript parses the vote URL from the vote button element and then a GET request is made by creating an Image object in JS. You can see votes appear on your network tab under the image tab instead of Fetch/XHR, even though their response return type is text/html -- interesting little hack, although I'm not quite sure why it's done this way instead of fetching since it already requires JS.
- Izkata 4y agoThis is simply how it was done before XMLHttpRequest existed. If it ain't broke don't fix it, I guess.
- deleted 4y ago[deleted]
- IncRnd 4y agoThe vote/downvote buttons do not require JS. You can verify this in the same, under the network tab. There is disallowed JS request, but the vote succeeds independent of the JS not being allowed.