Why not work success: function()?(jquery.ajax)

hello
why not work success: function()?(jquery.ajax)

success: function(){
 $(this).fadeOut("slow",function(){
 $(this).parent().remove();
 });
 }

That function is being called without a jquery object, so variable “this” is undefined.

I suggest to assign some id to your item and then using that id in handler.

Thanks!
My problem was solved.this code ok?

$('.tableeven tr').hover(function(){
        $(this).addClass('over');
    }, function(){
        $(this).removeClass('over');
    }).click(function(){
        checkBox = $(this).find("input").attr('checkbox', 'checked');
        $id = $('input:checkbox:checked').val();
        if (checkBox.attr('checked')) {
            $(this).css('backgroundColor', "");
            checkBox.attr('checked', '');
        }
        else {
            checkBox.attr('checked', 'checked');
            $(this).css('backgroundColor', "#140d01");
        }
    });
    $('#delete_i').click(function(){
        $('.chk').each(function(){
            if ($(this).attr('checked')) {
                var dataString = 'checkbox=' + $('input:checkbox:checked').val();
                $(this).parent().parent().fadeOut("slow");
                var self = this;
                $.ajax({
                    type: "POST",
                    url: "http://localhost/parsdiba/index.php/admin/customer_size/delete",
                    data: dataString,
                    cache: false,
                    success: function(){
                    },
                    error: function(data){
                        alert('Load was performed.');
                    }
                })                
            }
        })
    });

You should use prop(‘checked’) instead of attr(‘checked’) and prop(‘checked’, true) instead of attr(‘checked’, ‘checked’) if you are using jQuery 1.6 or newer version.

This line is useless because you aren’t using variable “self”:

var self = this;

Other than that, code seems to be ok.

1- .prop() right used?
2- How do I change the code for delete multiple rows from mysql?


    $('.tableeven tr').hover(function(){
        $(this).addClass('over');
    }, function(){
        $(this).removeClass('over');
    }).click(function(){
        checkBox = $(this).find("input").prop('checkbox', 'checked');
        $id = $('input:checkbox:checked').val();
        if (checkBox.prop('checked')) {
            $(this).css('backgroundColor', "");
            checkBox.prop('checked', '');
        }
        else {
            checkBox.prop('checked', 'checked');
            $(this).css('backgroundColor', "#140d01");
        }
    });
    $('#delete_i').click(function(){
        $('.chk').each(function(){
            if ($(this).prop('checked')) {
                var dataString = 'delete[]=' + $('input:checkbox:checked').val();
                $(this).parent().parent().fadeOut("slow");
                $.ajax({
                    type: "POST",
                    url: "http://localhost/parsdiba/index.php/admin/customer_size/delete",
                    data: dataString,
                    cache: false,
                    success: function(){
                    },
                    error: function(data){
                        alert('Load was performed.');
                    }
                })                
            }
        })
    });

  1. No, second parameter is ether true or false, not ‘checked’

Please answer to question 2.
Now it is right?


else {
            checkBox.prop('checked', 'true');
            $(this).css('backgroundColor', "#140d01");
        }