jQuery Ajax request every 30 seconds

You can put your code in a separate function like this: function LoadFinance() { $(function() { $.getJSON( “http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22%5EFTSE%22)%0A%09%09&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=?”, function(json){ $(‘#finance’).text(json.query.results.quote.Change); // Patching payload into page element ID = “dog” }); }); } And then set up a timer calling the function every 30 seconds: setInterval( LoadFinance, 30000 );

YQL: html table is no longer supported

It looks like Yahoo did indeed end their support of the html library as of 6/8/2017 (according to my error logs). There doesn’t appear to be any official announcement of it yet. Luckily, there is a YQL community library that can be used in place of the official html library with few changes to your … Read more