title: window.onload Not Working correclty
body: <p>This is a simple function to show the date (I don't want professional ones so this is enough).
  The problem is that I want to show it when the page loads. I don't want the user to press on any buttons or anything, but it's not working.</p>
  
  <p>Here it is: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.onload = ReturnDay;
  &lt;/script&gt;
  
  &lt;script&gt;
      function ReturnDay() {
          var monthNames = [ 
              "January", 
              "February", 
              "March", 
              "April", 
              "May", 
              "June",
              "July", 
              "August", 
              "September", 
              "October", 
              "November", 
              "December" 
          ];
          var dayNames= [
              "Sunday",
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday"
          ];
          var newDate = new Date();
  
          newDate.setDate(newDate.getDate() + 1);    
  
          $('#dateday').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear());​
      }
  &lt;/script&gt;
  
  &lt;input id="dateday" type=text&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>Thanks a lot.</p>