I am trying to append a table with data from another page that is in json form
Here's my code to append
$.getJSON("<?php echo URL;?>/dashboard/sellorders", function(data)
{
$.each(data.result, function(){
$("#sellingorders").find('tbody').apend("<tr><td>"+this['price']+"</td><td>"+this['amount']+"</td><td>"+this['cost']+"</td></tr>");
})});
<div id="example-2_wrapper" class="table-responsive dataTables_wrapper form-inline dt-bootstrap no-footer">
<table id="sellingorders" class="table table-bordered table-striped dataTable no-footer " role="grid" aria-describedby="example-2_info">
<thead>
<tr>
<th>
<?php _ex( "Price"); ?>
</th>
<th>
<?php _ex( "Amount"); ?>
</th>
<th>
<?php _ex( "Cost"); ?>
</th>
</tr>
</thead>
<tbody><tbody>
<tfoot>
Yet none of it is appending, no data is being added to the table.
Aucun commentaire:
Enregistrer un commentaire