Skip to content

Instantly share code, notes, and snippets.

@jsmestad
Created January 21, 2009 07:56
Show Gist options
  • Select an option

  • Save jsmestad/49889 to your computer and use it in GitHub Desktop.

Select an option

Save jsmestad/49889 to your computer and use it in GitHub Desktop.
jQuery(function() {
function follow() {
var self = $(this);
$.post(this.href + ".js", { "shortcode": this.id }, null, "script");
self.removeAttr('href').unbind('click');
return false;
}
function unfollow() {
var self = $(this);
$.post(this.href + ".js", { "_method": "delete" }, null, "script");
self.removeAttr('href').unbind('click');
return false;
}
$("a.follow-start").click( follow() );
$("a.follow-stop").click( unfollow() );
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment