PDA

View Full Version : my first java menu question


mels
06-07-2005, 03:12 PM
Hi,

I'am new to java and found a script for menu's.
see http://train.mels-kooijman.nl/html/train-info-1.html only the first link is working for now.
I want to know is it is possible for the menu defenition, to put it outside the page, like with css in a external script.
The second question: when i add one more menu option, the menu don't work anymore, is this a mozilla/firefox problem?

Thanks in advange
Mels

_Aerospace_Eng_
06-07-2005, 03:25 PM
Java is NOT Javascript don't confuse them. They are two totally different languages. As far as having more than one, well you would have to duplicate the array, and every function and variable each time you want to use it. If I get time later I might be able to work up one that will allow you to use it more than once on a page.

mels
06-07-2005, 05:18 PM
Sorry i mixed up java and javascript.
Its not a problem to get a second menu on the same page, i declare a menu2[x] that works.
I want to ad another menu item, i see max 6 items. when i add 1 menu item more iget the default.
The first question is the most inportant, can i just as i do wirh css put the line:
var menu1=new Array()
menu1[0]='<a href="http://home.wanadoo.nl/m.m.kooijman/">De oude treinen site</a>'
etc.

in a script outside the html page

Mels

mels
06-08-2005, 03:38 PM
The "problems" are solved.
To put the defenitions in a seperate script i found on a site:
<script type="text/javascript" src="menu.js"></script>

I changed:
menu1[5]='<a href="../html/my-trains.html">Foto's</a>'
to
menu1[5]='<a href="../html/my-trains.html">Foto\'s</a>'

thanks
Mels

_Aerospace_Eng_
06-08-2005, 03:49 PM
O okay, sorry I misread your post, yeah you have to escape any single quotes. Sorry about that.