у меня есть этот jquery-код, который отлично работает, но изображение в конце не меняется на src, указанный здесь:
JQuery:
$(document).ready( function() {
$("a.vote_up").click(function(){
//get the id
var the_id = $(this).attr('id');
//the main ajax request
$.ajax( {
type: "POST",
data: "action=vote_up&id=" + the_id,
url: "ajax/votes.php",
success: function( msg ) {
$("span.vote_count#"+the_id).html(msg).fadeIn();
// my problem is here
$(".vote_up#" + the_id + " img").attr("src", "img/upvoteActive.png");
}
} );
} );
} );
HTML-код:
<a href='#' class='vote_up' id="$id"><img src="img/uparrow.png" /></a>