Skip to content

Instantly share code, notes, and snippets.

@jawinn
Created June 18, 2014 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jawinn/327db34270caf4f3ff0c to your computer and use it in GitHub Desktop.
Save jawinn/327db34270caf4f3ff0c to your computer and use it in GitHub Desktop.
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