add +1 or -1 value with like
hi every one i am working on socila website project now i am at end of
this but geting 1 problem i want to setup when click like button then its
show +1 with existing likes value . if already 10 likes then after click
on like its change into 11. but i did not find any solutin . i fin eaiest
script . below my working script like and unlike,
<script type="text/javascript">
$(document).ready(function () {
$(".like").click(function () {
var ID = $(this).attr("id");
var REL = $(this).attr("rel");
var URL = 'box_like.php';
var dataString = 'msg_id=' + ID + '&rel=' + REL;
$.ajax({
type: "POST",
url: URL,
data: dataString,
cache: false,
success: function (html) {
if (REL == 'Like') {
$('#' + ID).html('Unlike').attr('rel',
'Unlike').attr('title', 'Unlike');
} else {
$('#' + ID).attr('rel', 'Like').attr('title',
'Like').html('Like');
}
}
});
});
});
</script>
if somone add this script into likes counter i wil be thank full
No comments:
Post a Comment