jQuery(document).ready(function() { jQuery(".post-like a").click(function(){heart=jQuery(this);post_id=heart.data("post_id");jQuery.ajax({type:"post",url:ajax_var.url,data:"action=post-like&nonce="+ajax_var.nonce+"&bdaia_post_like=&post_id="+post_id,success:function(e){if(e!="already"){heart.addClass("voted");heart.siblings(".count").text(e)}}});return false}); });