4 ms·
Keeping in mind that I'm not advocating this per se but in the spirit of exploration: In the case of HN ui, no response from the server is strictly necessary o
by IggleSniggle 3y ago
Keeping in mind that I'm not advocating this per se but in the spirit of exploration:
In the case of HN ui, no response from the server is strictly necessary on submit, and thus no reload is needed. Hence mentioning <input type="submit"> rather than <form>. You can indicate that the vote was made by using a checkbox and styling appropriately. A submitted comment can be similarly controlled with CSS.
For non-HN cases, you can do long-polling, where the original response from the server is never closed, and thus you can always append new HTML to the end, hiding outdated elements as necessary with CSS.
Example:
<iframe name="do_nothing" style="display:none;"></iframe>
<form action="vote" target="do_nothing">
<input type="submit" name="my_vote" value="up">
<input type="submit" name="my_vote" value="down">
<input type="hidden" name="comment_id" value="234">
</form>