|Java menu knowledge base|
to dynamically populate the java menu at runtime. (The difference between java
It is also possible to use client-side scripts to manipulate the content of the
java menu after it has been populated for each session. This second topic is not
the subject of this article - it is discussed under exposed methods.
Most of our commercial menus can read their content (text and hyperlinks) from both
external files and parameters. External files are files other than the HTML file with
the menu. Parameters are special HTML tags contained within the same HTML file as the menu.
A parameter which creates a menu item in a menu might look like this:
<param name=entry0 value="TEXT:my text|1|2|LINK:myPage.htm,myFrame|comment">
The format for such parameter indices is described further here.
As a parameter is a tag just like any other piece of HTML, it can be manipulated dynamically using
which forks between two different document.write() statements, which write different
if (username=="bob") document.write("<param name=entry0 value='TEXT:Bob's menu|1|2|LINK:bob.htm| '>");
else document.write("<param name=entry0 value='TEXT:General menu|1|2|LINK:general.htm| '>");
More complex scripting
Once you've understood the principle that parameters can be dynamically generated, you can quickly
to your parameters.
However before you get too carried away by this kind of thing, remember that java is much more
lead to poor performance. For large scale applications, your dynamic scripting should be done on
the server and read directly from the server by the applet - this is a much
more elegant way of creating dynamic content for java menus.
For the same reason as stated above (the comparatively inefficient use of clients-side resources),