upvote.onclick=func(){ hideButton(); doRequest(); }
Please do: upvote.onclick=func(){ doRequest().onsuccess(func(){ hideButton(); } }
Upvotes, or downvotes for that matter, don't always go through, but this is in no way made visible. Especially when pressing the back button, the browser might load a cache with expired links. Or when using a mobile connection, the connection often drops and you never know when it's safe to navigate away from the page.