syntax a: not working, the parent of current element not being removed

                        $('a.del').click(function(e){
                                e.preventDefault();
                                $.post('/img/del.php') ,
                                                {'img': img },
                                                function(e){
                                                        if(e.status == 
'deleted') {$(this).parent().remove();}
                                                }, 'json');
                        });

syntax b: work but its not doing things correctly.

                        $('a.del').click(function(e){
                                e.preventDefault();
                                $.post('/img/del.php'),
                                                 {'img': img },
                                                function(e){
                                                        if(e.status == 
'deleted') {}
                                                }, 'json');
                                $(this).parent().remove();
                        });

Reply via email to