[Contents]

jsEditor - How to get a list of files and titles

Aim: to demonstrate how get a list of files

Double-clicking on the directories in the box on the left of the jsEditor, navigate to the directory containing these files.

Start a new blank files, if necessary and save it as 1111.htm. If you do not save the file at least once, jsEditor will complain that it can't work out relative filenames for an unnamed file. (Actually, it could, but it won't because it doesn't like doing navigation on a file you might save elsewhere!)

Click on jsalerts.htm. Then right-click on the JS mode button and select Insert and then Relative Filename from the JS popup menu. jsEditor will add the currently selected file (jsalerts.htm) at the cursor.

Realising that this can get tedious, select JS mode (so hot key will work) and choose the next file (jsalertslink.htm) and press Control N. The filename will be added at the cursor.

In this way, you can get a list of relative filenames. You can select them from where you like.on your computer. This is how I got the list of files for the previous lesson.


Click somewhere in the document where you want to start a list of titles. Select a file as before and right-click over the JS mode button (if necessary, or on the page if you are in JS mode). Choose Insert and the File Title. Note you can use Control T if you are in JS mode.

Select the files as in the previous section and use the menu or Control T to insert File Titles.

With this new knowledge, why not repeat the previous lesson, only make your list for the array yourself.

 

You have learned how to:

Next: How to get a list of colours