Calendar applet, calling javascript function

What does this example show ?

This example shows how to call a javascript function from the applet. Our function is named alertDate(); The applet provides 3 functions that can be called from a javascript function.
  • GetYear(), return an integer representing the year
  • GetMonth(), return an integer representing the month
  • GetDay(), return an integer representing the day in the month


<param name="event_file" value="./example.evt">
Click on a day to call the function alertDate().

HTML applet code

Don't forget to add the keyword MAYSCRIPT if you want the applet to call the function.

    name=ccalendar MAYSCRIPT
	id = "cal">
<param name="color_fond" value="CCCCFF">
<param name="color_case" value="C0C0FF">
<param name="color_Comment" value="AAAAFF">
<param name="color_empty" value="9090FF">
<param name="jvf" value="alertDate()">

javascript code

function alertDate()
 alert("Year = "+document.ccalendar.getYear()+", month="+document.ccalendar.getMonth()+", day="+document.ccalendar.getDay());