0
クリックして投票を有効にすると、投票を無効にすることができます。有効なボタンをクリックすると無効になります。リンクのjQueryでボタン/リンクを無効/有効にする方法は?
$("a.vote_down").click(function() {
//get the id
the_id = $(this).attr('id');
//the main ajax request
$.ajax({
type: "POST",
data: "action=vote_down&id="+$(this).attr("id"),
url: "votes.php",
success: function(msg) {
$(".vote_down").addClass("active");
$(".vote_up").removeClass("active");
$("span#votes_count").html(msg);
}
});
});
ワン:
<a href='javascript:;' class='vote_up<?php if($liked["points"]=="1") echo " active";?>' id='<?php echo $id; ?>'>Vote Up</a>
、あなたも'機能を追加したい場合があります(E ) 'を' e.preventDefault() 'に置き換えます。 –