tags:

views:

36

answers:

0

Can anyone help fix the code below...

I'm loading data into a table with three columns using the code below into a table on clicking a link (This part works fine by itself):

$(document).ready(function() { 
    $("#myTable").tablesorter();
    $("#ajax-append").click(function() { 
        $.get("get_data.php", function(html) { 
             $("#myTable tbody").append(html);              
             $("#myTable").trigger("update");     
        });
        return false;

    });                
});  

However now I want to run another function after this part is completed to get additional information and place it into the last column of my table.

Unfortunately nothing happens at all.

$(document).ready(function() { 
  $("#myTable").tablesorter();
  $("#ajax-append").click(function() { 
    $.get("get_data.php", function(html) { 
         $("#myTable tbody").append(html);              

         $('#myTable tr').each(function(index)){
             var col1 = $(this).children('td.col1').text();
             $(this).children('td.col3').load('more.php?url='+col1);
         });

         $("#myTable").trigger("update"); 

    });
    return false;

  });                
});