How would I re-run this jQuery code every second please?
$.getJSON('http://example.com', function(data) {
console.log(data);
});
I have done some research and it said I needed to put it into a function
and set an interval
, however I am not sure how to do this.