This (Javascript) function has an onClick event that calls a function that calls This function



In Delphi, my problem is solved with a Forward Declaration. Is there a
similar solution in JavaScript. Yes, I know this is a Delphi group, but I
don't know the JavaScript term for "Forward"!

The title says it all. The prevmon() function is listed afterward, since it
calls fDrawCal().I'm sure you see the problem...prevmon(), in the onClick
event, is not defined prior to being mentioned in the onClick event. But
what's the solution? Here's the structure that I have now:

function fDrawCal(iMonth, iYear) {
...
document.write('<a onClick="prevmon()" ................
...
etc.
...
}

function prevmon() {
iMonth = iMonth-1;
if (iMonth==0) {iYear=iYear-1; iMonth=12}
fDrawCal(iMonth, iYear); }


.