Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8817961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:58:51+00:00 2026-06-14T04:58:51+00:00

my updated full script: $(document).ready(function() { $.getJSON(‘table.json’,function(data){ $(‘#mytable’).empty(); var html = ”; html +=

  • 0

my updated full script:

$(document).ready(function() {
                 $.getJSON('table.json',function(data){

                    $('#mytable').empty(); 
                    var html = '';
                    html += '<tr class="tableheader"><th>Name</th><th>Code</th><th>Value</th><th>Bid</th><th>Offer</th></tr>';
                    for (var i=0, size=data.length; i<size;i++) {                           
                            html += '<tr class="tablecontent"><td>'+ data[i].name+ '</td><td>'+ data[i].code+ '</td><td>'
                                         + data[i].value+ '</td><td>'
                                         +data[i].bid+'</td><td>'+data[i].offer+'</td></tr>';
                            }

            $('#mytable').append(html);
            tablerows('mytable');
            setTimeout(poll,5000);

        });




        });

        var poll = setInterval(function(){
        $.ajax({
        type:"GET",
        url: "dummy.json",
        success: function(data){
        //HANDLE DATA
         setTimeout(poll,5000);
    }
   });
},5000);

Please help me in this. i have 3 JSONs. 1st Json will load initially. That is done.

2nd json needs to be parsed (which has 2 field changes) and show the initial json + changed fields and then again from 3rd JSON.

I have written below script:

var poll = setInterval(function(){
        $.ajax({
        type:"GET",
        url: "dummy.json",
        success: function(data){
        //HANDLE DATA
         JSON.parse(data); 
    }
   });
},5000)

dummy.json is my second changed JSON. Is this the correct way?how should i call this function function in my $(document).ready?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:58:52+00:00Added an answer on June 14, 2026 at 4:58 am

    Set it as a regular function and then call it from itself within the success handler so then you are never getting ahead of yourself. Then you can also just call it once from your $(document).ready.

    var poll = function(){
        $.ajax({
            type:"GET",
            url: "dummy.json",
            success: function(data){
            //HANDLE DATA
                setTimeout(poll,5000);
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATED: I have some table with sync_numbers, like this: --------------------- id | sync_number ---------------------
I am trying to implement jquery full calendar with json event updates. I have
Update :- My updated script is second one and which is working perfect (
Updated I have posted a script I'm using for this to the StackExchange Code
I have a div which in jquery's document ready I append - using $(#div
I have a script that adds full images dynamically over thumbnails when you hover
My ascx control inside a container update panel does a full page refresh when
I have a folder full of 100-odd Access97 files. I need to update them
Updated-2 I have interesting combination of warnings & errors. Firstly, when debugging, i get
Updated Example: http://jsfiddle.net/7Cwbn/62/ You can click on the markers Hold Ctrl to select multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.