|
Michael Beck - 2016-02-02 07:23:03
On the demo here, I can click on "Like" and then on "Dislike", and the vote on "Like" is still there.
I would be better, when I click the "Dislike", my vote on "Like" would transfer to "Dislike"
Vishv Sahdev - 2016-02-02 07:50:20 - In reply to message 1 from Michael Beck
<span class="glyphicon glyphicon-thumbs-up onclick" aria-hidden="true" aria-value="214" id="UP214"> 2 </span><span class="glyphicon glyphicon-thumbs-down onclick" aria-hidden="true" aria-value="214" id="DOWN214"> 0 </span>
-------------------------------------------------
//class update onclick
$(".onclick").one("click",function(){
var id = $(this).attr("aria-value");
$.ajax({
url : "/widget/com",
type: "POST",
data : {"type": "dislike","id":id},
success: function(data)
{
$("#DOWN"+id).text(" " +data);
}
});
$(this).text(d + "v");
});
Vishv Sahdev - 2016-02-02 07:58:36 - In reply to message 2 from Vishv Sahdev
<span class="glyphicon glyphicon-thumbs-up onclick" data-id="UP" data-value="like" aria-hidden="true" aria-value="214" id="UP214"> 2 </span><span class="glyphicon glyphicon-thumbs-down onclick" data-id="DOWN" data-value="dislike" aria-hidden="true" aria-value="214" id="DOWN214"> 0 </span>
$(".onclick").one("click",function(){
var id = $(this).attr("aria-value");
var data_id = $(this).attr("data-id");
var data_value = $(this).attr("data-value");
$.ajax({
url : "/widget/com",
type: "POST",
data : {"type": data_value,"id":id},
success: function(data)
{
$("#"+data-id+id).text(" " +data);
}
});
$(this).text(d + "v");
});
|