Skip to content

Instantly share code, notes, and snippets.

@bootandy
Created March 12, 2013 15:18
Show Gist options
  • Save bootandy/5143774 to your computer and use it in GitHub Desktop.
Save bootandy/5143774 to your computer and use it in GitHub Desktop.
jquery. All elements of class 'closer' now fire off an AJAX request to attr 'ajax_href' and remove themselves from the DOM
$('.closer').click(function() {
var url = $(this).attr('ajax_href');
$.ajax({
type: "POST",
url: url,
});
$(this).parent().fadeOut('fast', function() {
console.log('Im gone);
});
});
// Refer to: http://api.jquery.com/jQuery.post/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment