Created
June 18, 2014 17:17
-
-
Save jawinn/327db34270caf4f3ff0c to your computer and use it in GitHub Desktop.
I Recommend This - JS Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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