title: JQuery: change content of <div> every 5 seconds
body: <p>I've set up a radio broadcast server using xml and xslt.
  I display the current song playing, but of course, that changed every minute, so I'd like that the <code>&lt;div&gt;</code> refreshes every second to make sure the displayed data is up-to-date.</p>
  
  <p>I've written a JQuery function, but that does not work.
  Also, i've written following test function to test if jquery works, and it doesn't.</p>
  
  <p>Could it be that jquery does not work in an XST page??</p>
  
  <p>Test function:</p>
  
  <pre><code>$(document).ready(function () {
          $("a").click(function () {
            alert("test");
              });
          });
  </code></pre>
  
  <p>The alert is not displayed when I click on a hyperlink...</p>
  
  <p>This is my current code:</p>
  
  <pre><code>    &lt;xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" &gt;
  &lt;xsl:output omit-xml-declaration="no" method="html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" /&gt;
  &lt;xsl:template match = "/icestats" &gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"&gt;
      $(document).ready(function () {
          setInterval(function () {
              $(".newscontent").load("status.xsl");
          }, 1000);
      });
    &lt;/script&gt;
    &lt;script type="text/JavaScript"&gt;
      window.onload = startTime;
      function startTime()
      {
      var date = new Date();
      var uur = date.getHours();
      var min = date.getMinutes();
      var sec = date.getSeconds();
  
      if(min == 0 || min == 1 || min == 2 || min == 3 || min ==4 || min == 5 || min == 6 || min == 7 || min == 8 || min == 9)
      {
      min = "0" + min;
      }
      if(sec == 0 || sec == 1 || sec == 2 || sec == 3 || sec ==4 || sec == 5 || sec == 6 || sec == 7 || sec == 8 || sec == 9)
      {
      sec = "0" + sec;
      }
  
      var movingtime = uur + ":" + min + ":" + sec;
      document.getElementById('clock').innerHTML = movingtime;
      setTimeout('startTime()',500);
      }
    &lt;/script&gt;
  
    &lt;title&gt;Muziekserver&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
  &lt;/head&gt;
  &lt;body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"&gt;
  &lt;h2&gt;Overzicht&lt;/h2&gt;
  &lt;br /&gt;
  &lt;!--index header menu --&gt;
  &lt;div class="roundcont"&gt;
  &lt;div class="roundtop"&gt;
  &lt;img src="/corner_topleft.jpg" class="corner" style="display: none" /&gt;
  &lt;/div&gt;
  &lt;table border="0" width="100%" id="table1" cellspacing="0" cellpadding="4"&gt;
      &lt;tr&gt;
          &lt;td bgcolor="#656565"&gt;
          &lt;a class="nav" href="admin/"&gt;Administratie&lt;/a&gt;
          &lt;a class="nav" href="status.xsl"&gt;Overzicht van muziek&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;div class="roundbottom"&gt;
  &lt;img src="/corner_bottomleft.jpg" class="corner" style="display: none" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;!--end index header menu --&gt;
  &lt;!--mount point stats--&gt;
  &lt;xsl:for-each select="source"&gt;
  &lt;xsl:choose&gt;
  &lt;xsl:when test="listeners"&gt;
  &lt;div class="roundcont"&gt;
  &lt;div class="roundtop"&gt;
  &lt;img src="/corner_topleft.jpg" class="corner" style="display: none" /&gt;
  &lt;/div&gt;
  &lt;div class="newscontent"&gt;
      &lt;div class="streamheader"&gt;
          &lt;table cellspacing="0" cellpadding="0"&gt;
              &lt;colgroup align="left" /&gt;
              &lt;colgroup align="right" width="300" /&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;h3&gt;Naam:  &lt;xsl:value-of select="@mount" /&gt;&lt;/h3&gt;&lt;/td&gt;
                  &lt;xsl:choose&gt;
                      &lt;xsl:when test="authenticator"&gt;
                          &lt;td align="right"&gt;&lt;a class="auth" href="/auth.xsl"&gt;Login&lt;/a&gt;&lt;/td&gt;
                      &lt;/xsl:when&gt;
                      &lt;xsl:otherwise&gt;
                          &lt;td align="right"&gt; Speel af als &lt;a href="{@mount}.m3u"&gt;M3U&lt;/a&gt; of als &lt;a href="{@mount}.xspf"&gt;XSPF&lt;/a&gt;&lt;/td&gt;
                      &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;
          &lt;/tr&gt;&lt;/table&gt;
      &lt;/div&gt;
  
  &lt;table border="0" cellpadding="4" id="info"&gt;
  &lt;xsl:if test="server_name"&gt;
  &lt;tr&gt;&lt;td&gt;Naam&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="server_name" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="server_description"&gt;
  &lt;tr&gt;&lt;td&gt;Beschrijving&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="server_description" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="genre"&gt;
  &lt;tr&gt;&lt;td&gt;Genre&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="genre" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="bitrate"&gt;
  &lt;tr&gt;&lt;td&gt;Bitrate&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="bitrate" /&gt; kbps&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="quality"&gt;
  &lt;tr&gt;&lt;td&gt;Quality:&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="quality" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="video_quality"&gt;
  &lt;tr&gt;&lt;td&gt;Video Quality:&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="video_quality" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="frame_size"&gt;
  &lt;tr&gt;&lt;td&gt;Framesize:&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="frame_size" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="frame_rate"&gt;
  &lt;tr&gt;&lt;td&gt;Framerate:&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;xsl:value-of select="frame_rate" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test="server_url"&gt;
  &lt;tr&gt;&lt;td&gt;URL&lt;/td&gt;&lt;td class="streamdata"&gt; &lt;a target="_blank" href="{server_url}"&gt;&lt;xsl:value-of select="server_url" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/xsl:if&gt;
  &lt;tr&gt;&lt;td&gt;Nu bezig&lt;/td&gt;&lt;td class="streamdataArtist"&gt; 
  &lt;xsl:if test="artist"&gt;&lt;xsl:value-of select="artist" /&gt; - &lt;/xsl:if&gt;&lt;xsl:value-of select="title" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;div class="roundbottom"&gt;
  &lt;img src="/corner_bottomleft.jpg" class="corner" style="display: none" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;/xsl:when&gt;
  &lt;xsl:otherwise&gt;
  &lt;h3&gt;&lt;xsl:value-of select="@mount" /&gt; - Not Connected&lt;/h3&gt;
  &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
  
  &lt;/xsl:for-each&gt;
  &lt;xsl:text disable-output-escaping="yes"&gt;&amp;amp;&lt;/xsl:text&gt;nbsp;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>