Adding Documents/Links

The things that live inside the folders are called both links and documents in the FolderTree code. It's a little confusing, but for now, just keep in your mind that documents and links are the same thing in the FolderTree universe.

In Figure 20-3, the two links are “Edinburgh” and “London.” Clicking these links will change the content of the other frame (the one containing the picture of Boston harbor in Figure 20-2).

Figure 20-3. Two links

Adding links is very similar to adding folders. Here's how we add the Edinburgh link to the Scotland folder:

 insDoc(aux3, gLnk(2, "Edinburgh", "www.geocities.com/ marcelino_martins/ftexample/beenthere_edinburgh.gif")) ...

Get Advanced JavaScript™: Insights and Innovative Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.