Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
How to print multiple object json data into html table with set interval?

I want to print json (response) into an html table. i want the following information in the table.

  1. Tracking id = data.items.tracking_id
  2. Update Date = data.items.origin_info.trackinfo.z9.z1.date
  3. Current City = data.items.origin_info.trackinfo.z9.z1.Details
  4. Current Status = data.items.origin_info.trackinfo.z9.z1.checkpoint_status

here is my code setup.

const settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://order-tracking.p.rapidapi.com/trackings/realtime",
    "method": "POST",
    "headers": {
        "content-type": "application/json",
        "x-rapidapi-host": "order-tracking.p.rapidapi.com",
        "x-rapidapi-key": "c1b4466148msh84c499d6e5590c4p155c1bjsne8487b7633cc"
    },
    "processData": false,
    "data": {
        "tracking_number": "CM436202938IN",
        "carrier_code": "india-post"
    }
};

setInterval(function() {
$.ajax(settings).done(function (response) {
//console.log(response);
      var sdata = '';
      $('#trackinfo').empty();
      $.each(response, function(key,value){
        sdata += '<tr>';
        sdata += '<td>'+value.data.items.tracking_number+'</td>';
        sdata += '<td>'+value.data.items.origin_info.trackinfo.z9.z1.date+'</td>';
        sdata += '<td>'+value.data.items.origin_info.trackinfo.z9.z1.Details+'</td>';
        sdata += '<td>'+value.data.items.origin_info.trackinfo.z9.z1.checkpoint_status+'</td>';

        sdata += '</tr>';
      });
       $('#trackinfo').html(sdata);
 }); }, 50000);
<table class="">
<thead>
<tr>
<th>Tracking ID</th>
<th>Update Date</th>
<th>Current City</th>
<th>Current Status</th>
</tr>
</thead>
<tbody id="trackinfo">

</tbody>

</table>

I am unable to get tracking information inside the html table. pls improve the code so the tracking information will be reflected inside the html table.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!