Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74353

Jquery Get ID on Each loop

$
0
0

html code

<?php
    while($row = mysqli_fetch_assoc($WltQRslt)){ $Ldate = $row['LastDate'];
            $Bdate = $row['DateBought'];
            $id=sprintf('%s_%s',$Ldate,$Bdate);echo "<tr ><td class='center'><i class='fa fa-database fa-3x' aria-hidden='true'></i>&nbsp;&nbsp;&nbsp;&nbsp;{$row['Server']}</td>
    <td id ='".$row['SNo']."'><i class='fa fa-line-chart fa-3x'></i>&nbsp;&nbsp;&nbsp;&nbsp;{$row['Profit']}</td>
    <td><i class='fa fa-refresh fa-spin fa-3x fa-fw'></i>&nbsp;&nbsp;&nbsp;&nbsp;<span class='date' date-start='$Bdate' date-end='$Ldate'></span></td>";
                }?> 

jquery code

$('table td[id]').each(function (index, element) {
    var id = $(element).attr('id');

     $.ajax({
     url:"get_server.php",
     method:"POST",
     data:{id:id},
     success:function(data)
     {
     var no=data.count;
     for(i=0; i<=no;i++)
     {
     var price  = data;
     console.log(price);
     }
     }
    }); 
});

this jquery function get all the ID`s of each row contaning ID value. i want that on each iteration it get id from proccess it then move on to another iteration?


Viewing all articles
Browse latest Browse all 74353


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>