title: Problem with first Windows 7 gadget getting javascript to run
body: <p>For my first windows gadget I'm trying to make one that displays the current time and date.  The code below is what I have, but I can't figure out why the javascript is not running.  Any ideas?</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=Unicode" /&gt;
      &lt;title&gt;Clock&lt;/title&gt;
      &lt;style type="text/css"&gt;
        body { width: 130px; height: 60px; margin: 1 1 1 2; }
        body { font-family: Segoe UI, Arial; font-size: 11px; font-weight: bold; white-space: nowrap; }
      &lt;/style&gt;
      &lt;script type="text/javascript"&gt;
        var background;
        var interval;
        var connection_id;
        var timeZone;
        var now;
  
        function load() {
          try {
            interval = 1000;
            connection_id = 0;
            timeZone = System.Time.currentTimeZone;
  
            update();
          }
          catch(e){}
        }
  
        function update() {
          try {
            now = new Date(Date.parse(System.Time.getLocalTime(timeZone)));
            curDate.innerHTML = now.format('M jS, Y');
            curTime.innerHTML = now.format('h:i:s A');
            clearTimeout(connection_id);
            connection_id = setTimeout("update()", interval);
          }
          catch(e) {}
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body onload="load()"&gt;
      &lt;div id="curDate"&gt;
      &lt;/div&gt;
      &lt;div id="curTime"&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>