/*You can, of course, add as many files to the array as you like, synchronising the entries in DATABAS1 with those in DATABAS2*/

databas1=new Array("index.html","alerts.htm","alertsText.htm","alertsImages.htm","jumpfunction.htm");

//We create an array to hold the names of the files

databas2=new Array("Contents of JavaScript","Message Boxes","Alerts from Text","Alerts from Images","Hyperlink Function");

//Then we create an array to hold the descriptions of the files


/*The variable, NumberOfFiles, hold the length of the array. It is, or should be the same for databas1 and databas2*/

//This function writes the contents page. If you use this program, you don't need to change anything below.

function ContentsWriter()
document.write("<h2>My Contents Page</h2><p>");
for (var x=0;x<NumberOfFiles;x++)
document.write("<a href="+databas1[x]+">"+databas2[x]+"</a><br>");

Back to Using an array to write your table of contents