Skip to content

Instantly share code, notes, and snippets.

@samwx
Last active August 29, 2015 14:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samwx/d3011ca18bd288132b66 to your computer and use it in GitHub Desktop.
Save samwx/d3011ca18bd288132b66 to your computer and use it in GitHub Desktop.
Load elements via Ajax
$(document).on("click", '.label-success', function(event) {
elemento = $(this);
$.ajax({
type: "POST",
url: "http://domain.com",
data: "my_data=" + elemento.parent().parent().attr('id'),
success: function(result){
elemento.parent().parent().hide().html(result).fadeIn('fast');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment