Jacob Hughes
Jacob Hughes

Reputation: 1

How can I refresh JSON data with JQuery?

Forgive me for asking what may appear a simple question, but I cannot seem to find an answer that I understand. I am relatively new to JavaScript and JQuery.

My problem is that I am retrieving JSON data from another server, however, this information changes fairly rapidly (It monitors the status and current latency of a server). I then parse the information in this feed to JavaScript variables and display it on my page.

How can I update this data within certain time intervals? for example, every minute, rather than it being updated when the user refreshes the page?

Thanks very much!

Jacob

Upvotes: 0

Views: 1109

Answers (2)

wong2
wong2

Reputation: 35720

You can use

setInterval(function(){
    // get new json result from server by Ajax here
}, interval_time);

Upvotes: 2

Related Questions