I have jquery issues that I have had for several days, I'm so new to this, so excuse my dumbness in this matter. thank:))
html code:
<ul class="statuses">
<li id="set_23" class="message">
<span class="vote_count">27</span>
<a href="#" class="vote_up"><img src="img/uparrow.png" /></a>
<a href="#" class="vote_down"><img src="img/downarrow.png" /></a>
</li>
</ul>
this is my jquery code:
$(document).ready(function() {
$('#statuses').delegate('.vote_up', 'click', function() {
var the_id = $(this).closest('.message').attr('id').split('_').pop();
$.ajax({
type: "POST",
data: "action=vote_up&id=" + the_id,
url: "ajax/votes.php",
success: function (msg) {
$(this).siblings("span.vote_count").html(msg).fadeIn();
$(this).children("img").attr("src", "img/uparrowActive.png");
}
});
});
});
EDIT: also jquery fade.in and src image change doesn’t work, I refer to the right range or class (now ajax request is executed)
source
share