function sendVote(id, url) {
    $.ajax({
        url: url,
        type: 'POST',
        cache: false,
        data: {},
        dataType: 'json',
        error: function (xhr, status, error) {
            alert(status);
        },
        success: function (json) {
            if (json.success && json.score) {
                var elm = '#score-q' + id;
                var plural = json.score.num_votes == 1 ? '' : 's';
                $(elm).html(json.score.score + ' (' + json.score.num_votes + ' vote' + plural + ')');
            } else {
                alert(json.error_message);
            }
        }
    });
    return false;
}
