help to parse data into cells
I'm trying to parse value for each row. It's only working when i put alert inside for loop. this is my code
- $(document).ready(function() {
-
- var rows = document.getElementById('customerTable').getElementsByTagName('tbody')[0].getElementsByTagName('tr');
-
- for (i = 1; i <= rows.length; i++) {
- value=rows[i].id;
- //alert(value);
-
- $.ajax
- ({
- type: "POST",
- url: "getdata.php",
- data: "value="+value,
- success: function(data)
- {
- $("#"+i).html(data);
- }
-
- }
-
- );
- }
- });
</script>
--------
- <?php
- $count=1;
- while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
- ?>
- <tr id="<?php echo $row['value'];?>">
- <td><?php echo $count; ?></td>
- <td><?php echo $row['Name']; ?></td>
- <td id="<?php echo $count; ?>">0</td>
- </tr>
- <?php $count+=1; }?>