Problem with my Javascript Code
<p>Could anyone tell me why this code doesn't work? I can't even get the alert(); in init() to work right...</p>

<pre><code>window.onload = init;

var downloadedstuff;

function init() {
alert();
   $.get('example.php' + '?v=' + Math.random(), success: function (data) { 
    downloadedstuff = data;

});
 doTimer();
 }
var t;
var timer_is_on=0;

function timedCount()
 {
  $.get('example.php' + '?v=' + Math.random(), success: function (data) { 
    if(data != downloadedstuff)
    {
    alert('SOMETHING HAPPENED!!!!');
    location.reload(true);
    }
    else
    {
    alert(data);
    }
 });
 t=setTimeout("timedCount()",5000);
 }
function doTimer()
 {
 if (!timer_is_on)
   {
   timer_is_on=1;
   timedCount();
   }
 }
</code></pre>

<p>once again, really sorry for all the questions, i just don't know what's wrong.</p>
