I\'ve managed to make simple voting system with single current score. Everything is fine but the problem is that when I click on a button to vote for this particular
You haven't shown the code, but presumably the AJAX request is fired on click of a .vote
element. If this is the case you can store a reference to the element which raised the event, then use DOM traversal to find the sibling .this
and change it's HTML. Something like this:
$('.vote').click(function(e) {
e.preventDefault();
var $vote = $(this); // store the element which raised the event here
$.ajax({
url: 'foo.php',
success: function(html) {
$vote.siblings('.this').html(html); // use siblings() to find .this to change
}
});
});