That frontend code already exists and does that every time you vote (line 27 of https://news.ycombinator.com/hn.js). The response content isn't used for anything at all.
What a pleasantly tiny script file. More site code should be this easy to read.
(if *ajax-request*
(upvote)
(upvote-and-generate-page))