|
July 2001 (Part IV)
After implementing a JavaScript menu option in the previous
WWW page, I've added it to the Projects
page, so that I can assess if it is useful in applying it
to other pages. The old page can be accessed from here.
The menu option is constructed using the links
of the previous version of the menu, but it is now much
more compact. The following is the table which is inserted
into each of the project pages:
If you interested the screen-shots on the
right-hand side show the differences between the two. The
advantages I think are:
 |
Cleaner interface. The basic menu now fits
into the full page, and can be expanded, as required.
|
 |
Easier updates, as I just have to change a
single file, rather than all of the pages when there
is a change.
|
 |
External file reference, which reduces the
ammount of code in each page.
|
The function call to add a Category is addCategory(). Yellow
boxed comments are added with the fourth argument of the
function call. For example, the string is defined with non-breaking
spaces ( ):
General information
on projects
will display the comment of General information on projects.
Try moving your mouse cursor over the menu options, and
the text comment should be displayed, as shown next:

|

Old projects page without JavaScript
menu [Enlarge]
[HTML]

New projects page with JavaScript menu
[Enlarge] [Current]
Here's an extract from the JavaScript:
|
addCategory("GENERAL",
"General", false, "General"); addCategoryLink("GENERAL",
"Main page", "pr_main.html"); addCategoryLink("GENERAL",
"Request/Ideas", "form_project.html"); addCategory("PROJECTS",
"Projects 2000/2001", false, "BEng projects 2000/2001");
addCategoryLink("PROJECTS", "Comp. and E-com", "pr_bell.htm");
addCategoryLink("PROJECTS", "Real-time booking", "pr_tait.htm");
addCategoryLink("PROJECTS", "Agents", "pr_holmes.htm");
addCategoryLink("PROJECTS", "TCP/IP Emulator", "pr_faisal.htm");
addCategoryLink("PROJECTS", "Database link", "pr_huet.htm");
addCategoryLink("PROJECTS", "Remote Learning", "pr_kevin.htm");
addCategoryLink("PROJECTS", "Linux drivers", "pr_cristiano.htm");
addCategoryLink("PROJECTS", "Networking MM", "pr_networking_mm.htm");
addCategory("PROJECTS2", "Projects 2001/2002", false,
"BEng projects 2001/2002"); addCategoryLink("PROJECTS2",
"On-line voting", "project_greig.htm"); addCategoryLink("PROJECTS2",
"Agent Recovery", "project_douglas.htm"); addCategoryLink("PROJECTS2",
"File Sharing", "project_mcgregor.htm"); addCategoryLink("PROJECTS2",
"HTTP Monitoring", "project_jack.htm"); addCategory("PROJECTS3",
"Prev. Hons", false, "Previous projects (Hons)");
addCategoryLink("PROJECTS3", "Fire Wire", "pr_kelvin.htm");
addCategoryLink("PROJECTS3", "E-Commerce", "pr_xavier.htm");
addCategoryLink("PROJECTS3", "File Sharing", "project_mcgregor.htm");
addCategory("PROJECTS4", "Prev. MSc", false, "Previous
projects (MSc)"); addCategoryLink("PROJECTS4", "Mobile
Agents", "res_marcus.htm"); addCategoryLink("PROJECTS4",
"Router", "res_router.htm"); addCategoryLink("PROJECTS4",
"Gigabit Ethernet", "res_giga.htm"); addCategory("PROJECTS5",
"Prev. MPhil/PhD", false, "Previous projects (MPhil/PhD)");
addCategoryLink("PROJECTS5", "RSA Method", "res_wang.htm");
addCategoryLink("PROJECTS5", "Components", "res_oli.htm");
|
The scripts are included with:
|
<script language=JavaScript
src="homepage.js"></script>
<script language=JavaScript src="projects.js"></script>
<script language=JavaScript> showHomePage();
</script>
|
|