Using JavaScript with ToolBook
One of the most exciting features found in ToolBook Instructor 2004 is the ability to incorporate JavaScript easily in the HTML product.
The Book Properties Dialog Box has a Web tab as shown here. All you need to do is click the Import button to locate your *.js file. In this case the file is time.js and it contains one function time().

This is the file time.js:
function tbfunction_time()
{
//get the date, the hour, minutes, and seconds
var the_date = new Date();
var the_hour = the_date.getHours();
var the_minute = the_date.getMinutes();
var the_second = the_date.getSeconds();
//put together the string and alert with it
var the_time = the_hour + ":" + the_minute + ":" + the_second;
alert("The time is now: " + the_time);
}
Note that in order for a function to be recognized by ToolBook it must be prefixed as shown here: tbfunction_time.
This is the simple code on a button that calls this function:
Click
here to see this work.