Where are the delete button(s) located? If the buttons are regenerated
from the page via AJAX, the click event has to be re-bind again on the
button.
You might consider using the live() function rather than click().

On Feb 22, 11:06 am, amaze646 <mazej.i...@gmail.com> wrote:
> Hello
>
> I having a problem wich I dont know how to solve. I have a list of
> users and each user listed have a button DELETE. When I click on that
> button, user is deleted. Now, when I delete user I want to update my
> list of users at same time. Problem is that when I delete one user,
> list refreshes properly, but the second time that I click on button
> user is not deleted.
>
> Here is my code:
> //this_file is the same file that contains this code. I tried
> #container but it is the same.
> //.delete is class for delete buttons.
> //delete.php is php script for deleteing users
> //containet is div where all content of this page is loaded.
>
>  $(document).ready(function() {
>    $(".delete").click(function() {
>      $.post("delete.php",{ id: $(this).val()}, function(){
>                 $("#container").load("this_file.php");
>          });
>    });
>  });

Reply via email to