Sorry if this has already been answered, I am just learning Javascript and can't seem to figure this one out.
I have the anonymous function below, which reads a json file and updates the html. It successfully updates every 30 s, the problem is I have to wait 30 s for the data to appear when the page loads. How can I modify the code below so it updates on load, and then it updates every 30 s?
$(function () {
setTimeout(function() {
$.ajaxSetup({ cache: false });
$.getJSON("data/ticket_data.json", function(result){
/*some more stuff here*/
});
},30000);
});