This is great. I love how unapologetically "good enough" this code is—it does the absolute minimum needed to get the job done, with zero extra ceremony. A great example is the `vote` function:
function vote (id, how, auth, _goto) {
vis($('up_' + id), how == 'un');
vis($('down_' + id), how == 'un');
var unv = '';
if (how != 'un') {
unv = " | <a id='un_" + id + "' class='clicky' " +
"href='" + vurl(id, 'un', auth, _goto) + "'>" +
(how == 'up' ? 'unvote' : 'undown') + "</a>"
}
$('unv_' + id).innerHTML = unv;
new Image().src = vurl(id, how, auth, _goto);
}
Hide the up_ and down_ vote buttons, then either erase the innerHTML of the un_ vote div or construct new HTML for it from scratch. To top it all off, let's just inform the server of the vote by creating a new throwaway Image element, because it works everywhere and is less verbose than fetch.