Auto-Refresh Windows Sidebar Gadget Example

It’s silly how trivial a thing like grabbing a webpage’s content every minute and displaying it in a Sidebar gadget is. Granted, my knowledge of JavaScript and the like is limited to some basic functions (and mostly Google searches) but still..

What I wanted to do is have a sidebar gadget that grabs a page’s content every minute and displays it. First I tried with regular JavaScript without any luck. I moved on to the more familiar jQuery library and got it to work after a while. The main problem was the IE engine of the Sidebar caching the pages. To bypass this I just pass along the Unix timestamp in the URL.

So.. after messing around for a while, especially since it worked after 1 minute in a regular webbrowser and having barely to none capabilities to debug a sidebar gadget, here’s the working code:

	<title>SVO Status</title>
    body{font-family:"Verdana", sans-serif;}
    body{margin:5px 2px 2px 2px;}
    body {background-color:#b0c4de;}
<script language="javascript" src="jquery.js"></script>  
<script type="text/javascript"> = true;
var refreshId = setInterval( function()
      var seconds = new Date().getTime();       
      var url = "" + seconds;
      $.get(url, function(data) {
    }, 60000);
<div id="result"></div>

This excludes the gadget.xml file, which of course has to be added as well as the jQuery library.

I didn’t find any ready-made result out there so hopefully this post can help anyone who would like to make a simple status-fetching gadget.