0

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

2 Answers 2

2

You can use

setInterval(function(){
    // get new json result from server by Ajax here
}, interval_time);
Sign up to request clarification or add additional context in comments.

Comments

0

You can use setTimeout: http://forum.jquery.com/topic/javascript-sleep-wait-and-use-of-settimeout

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.