Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
I Recommend This - JS Fix
jQuery(document).ready(function($){
$(document).on('click', '.dot-irecommendthis',function() {
var link = $(this);
if(link.hasClass('active')) return false;
var id = $(this).attr('id'),
suffix = link.find('.dot-irecommendthis-suffix').text();
$.post(dot_irecommendthis.ajaxurl, { action:'dot-irecommendthis', recommend_id:id, suffix:suffix }, function(data){
link.html(data).addClass('active').attr('title','You already recommended this');
});
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.