HateEternal
Mac Metal Head
While working on my first widget (basically an UGLY rss reader for this site) I have run into a problem getting the rss to refresh. I am using setInterval to call the request method that I wrote which 1. updates the rss and 2. updates the Last update time.
Everything works fine in Safari, but in Dashboard the initial xml request is made and parsed and displayed, but it never updates. I thought it was a problem with setInterval but the time updates no problem.
Any ideas?
Everything works fine in Safari, but in Dashboard the initial xml request is made and parsed and displayed, but it never updates. I thought it was a problem with setInterval but the time updates no problem.
Any ideas?
Code:
function init()
{
makeRequest();
interval = setInterval("makeRequest();", refreshSeconds * 1000);
}
function makeRequest()
{
xmlRequest = null;
xmlRequest = new XMLHttpRequest();
xmlRequest.onreadystatechange = handleResponse;
xmlRequest.open("GET", rssURL, true);
xmlRequest.send(null);
}
function handleResponse()
{
if(xmlRequest.readyState == 4)
{
parseXML(xmlRequest.responseXML);
date = new Date();
updateDate(date.getHours(), date.getMinutes());
}
}