Greetings colleagues,
I've boiled down my code to the essence of the problem; a variable which serves as a parameter to a function keeps coming up as 'undefined'. The code is quite simple:
....
<head>
<title>Yearly Calendar</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<link href="yearly.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function writeMonthCell(calandarDay, currentTime)
{
alert(typeof calendarDay);
var this_DATE=new Date(calendarDay);
document.write("inside writeMonthCell the date is: " + this_DATE);
in the main body the alert(typeof thisDate) displays 'object'; but when the function is called, writeMonthCell, inside the function the alert says 'calendar undefined' .
I'm perplexed; why is thisDate now undefined as a parameter?
function writeMonthCell(calandarDay, currentTime)
{
alert(typeof calendarDay);
var this_DATE=new Date(calendarDay);
document.write("inside writeMonthCell the date is: " + this_DATE);
}//end writeMonthCell function
</script>
I finally have things moving ahead again; thanks for your consideration just the same.
In the line:function writeMonthCell(calandarDay, currentTime), you normally think of calendarDay and currentTime as a place-holding parameters; I guess this is not so for date objects. Once I made sure that the calling statement had the same param. name, i.e. calendarDay the errors for 'undefined' stopped appearing.
Bookmarks