For example...

$(document).ready(function() {
  function clickHandler(e){
    var thisTR = $(this).parent().parent();
    $.post( "ajax.php", {template: "testTR"}, function(output){
        $(output).insertAfter(thisTR).find('.button_plus')
           .click(clickHandler);
        styleTables();
      });
  }
  $('.button_plus').click(clickHandler);
});


On Nov 4, 8:15 pm, alife <[EMAIL PROTECTED]> wrote:
> hey,
>
> my problem:
>
> with the following code I put a TR in my table. in this TR I have
> further (".button_plus") - elements. I want that the user is able to
> click on these further elements. how could I realize that?
> $(document).ready(function() {
> $(".button_plus").click(function() {
>                 $(this).load( "ajax.php", {template: "testTR"}, 
> function(output){
>                                 $(this).parent().parent().after(output);
>                                 styleTables();
>                         }
>                 )
>         });
>  });
>
> //ajax.php returns this:
>
> <tr>
>                                 <td><input name="" type="text" 
> value="Eintrag" /></td>
>                                 <td><input name="" type="text" 
> value="Eintrag" /></td>
>                                 <td><input name="" type="text" 
> value="Eintrag" /></td>
>                                 <td><img class="button_minus" 
> src="images/button_minus.png" />
> <img class="button_plus" src="images/button_plus.png" /></td>
>                         </tr>
>
> I hope you can help me, thank you in advance,
>
> alife

Reply via email to