Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by ssss ( 15 years ago )
$(function() {
$('.like').live('click',function()
{
var element = $(this);
var id = element.attr("id");
$.ajax({
type:"POST",
data:"postid="+id,
url: "/ajax/likepost",
success: function(data){
$(this).html('<img src="loading.gif" alt="please wait..."/>');
if(data=='OK')
{
$(this).empty();
$(this).removeClass();
$(this).addClass('dislike');
return true;
}
}
});
});
$('.dislike').live('click',function()
{
var element = $(this);
var id = element.attr("id");
$.ajax({
type:"POST",
data:"postid="+id,
url: "/ajax/dislikepost",
success: function(){
$(this).html('<img src="loading.gif" alt="please wait..."/>');
if(data=='OK')
{
$(this).empty();
$(this).removeClass();
$(this).addClass('like');
return true;
}
}
});
});
});
Revise this Paste