click on Row and call alert function

click on Row and call alert function

Hello,

 I created a table dynamically using Ajax.

  1. <div id="header_table1"> </div>
  2. $.ajax({
     type: "POST",
     url: "functions/ajax_output.php",
     data: {func: "loadHeaders", uid: val, radio: radio, offset: txtoffset, limit: txtlimit},
     success: function(data){
      $('#header_table1').html(data);
     }
    });

Now I want to click on each row of the created table and thus should read two values from columns . These should then call a new Ajax function and reload details .

I have now tried a call alert using the following function - but does not work when the table is created dynamically .

  1. $(document).ready(function(){
     $("tr").click(function(event){
      alert("Zeile");
     });
    });

For all other tables that were not created dynamically , it works.

 Can you help me here ?