Can anyone tell me why I am getting an undefined error, and what I can do to fix it? I appreciate your help.
<script>
window.onload=myday;
function myday(){
var day=new Array("sunday","monday","tuesday","wednesday","thursday","friday","saturday");
var d=new Date();
theDay=d.getDay();
for (i=0;i<=day.length;i++)
{
if (i!=theDay)
{
document.write("today is not " + day[i]);
document.write("<br />");}
else
{
document.write("today is " + day[i]);
document.write("<br />");}
}
}
</script>