Tuesday 15 May 2012

html - repetitive time call from a URL using JS -


I have a code that will catch an RSS feed and show it as a custom HTML feed, such as a page.

"I would like to know how to send a timely call back to the RSS URL to display new information and leave the non-current information." Basically refresh the page on the timer.

  Create the function onload () {// feed field that will capture Digg's feed. Var feed = new google.feeds.Feed ("http://131940.qld.gov.au/DMR.Modules/TTIEvents/RSS/RSS.aspx?regionid=0&aventcause=Incident"); Feed.setNumEntries (15); Feed.includeHistoricalEntries (); // Calling Load sends off request This requires a callback function. Feed.load (feedLoaded); }   

Any help would be great.

Thanks in advance.

You need to use window.setInterval . Here's an example:

  window.setInterval (online, 1000);   

The first parameter is the name of your function, and the second parameter is the number of milliseconds that the browser should wait before calling that function again.

This example will call the function OnLoad once.

No comments:

Post a Comment