Skip to content

Instantly share code, notes, and snippets.

@taleeb35
Created September 20, 2014 16:24
Show Gist options
  • Save taleeb35/3d3b3f9f19db1c7e4baf to your computer and use it in GitHub Desktop.
Save taleeb35/3d3b3f9f19db1c7e4baf to your computer and use it in GitHub Desktop.
Delete
$(document).ready(function() {
$('a.delete').click(function(e) {
var __this = this;
e.preventDefault();
var parent = $(this).parent("td").parent("tr");
$.ajax({
type: 'get',
url: $(__this).attr("href"),
beforeSend: function() {
parent.animate({'backgroundColor':'#fb6c6c'},300);
},
done: function( msg ) {
if(msg == "OK"){
parent.slideUp(300,function() {
parent.remove();
});
} else {
@emdeeeks
Copy link

if(msg == "OK"){
__this.parents('tr').slideUp();
} else {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment