jQuery(document).ready(function(){jQuery('body').on('click','.jm-post-like',function(event){event.preventDefault();heart=jQuery(this);post_id=heart.data("post_id");heart.html("<i id='icon-gear' class='icon-gear'></i><i class='icon-like fa fa-heart-o'></i>");jQuery.ajax({type:"post",url:ajax_var.url,data:"action=jm-post-like&nonce="+ajax_var.nonce+"&jm_post_like=&post_id="+post_id,success:function(count){if(count.indexOf("already")!==-1){var lecount=count.replace("already","");if(lecount==="0"){lecount="Me Gusta"}heart.prop('title','Me Gusta');heart.removeClass("liked");heart.html(lecount+"<i class='icon-unlike fa fa-heart-o'></i>")}else{heart.prop('title','No Me Gusta');heart.addClass("liked");heart.html(count+"<i class='icon-like fa fa-heart'></i>")}}})})});