Skip to content

Instantly share code, notes, and snippets.

@derencius
Created January 28, 2009 17:15
Show Gist options
  • Save derencius/54068 to your computer and use it in GitHub Desktop.
Save derencius/54068 to your computer and use it in GitHub Desktop.
var RemoteAndRemove = $.klass({
request:function(add) {
var url = $(this.element).url;
var element = $(this.element);
$.post(url,{authenticity_token: AUTH_TOKEN, complete: function(){ element.remove()} });
},
onclick:function(){
this.request();
}
});
jQuery(function($) {
$('.remote_and_remove').attach(RemoveAndRemove);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment