Click to See Complete Forum and Search --> : Menu reuse
Riverbourgeois
03-26-2003, 11:32 AM
Hello anyone;
I am writing a website where I use a javascript menu with a CSS for my text. Does anyone know how I can move my body of my menu from my <body> tag into a file. So that each time I want to add it to each page (I want it on each page of about 50 pages) I do not just to duplicate the code. Which will be a pain if I want to change it and would rather change it once and have it affect all pages.
Thank you
DaveSW
03-26-2003, 11:36 AM
Do you mean by using frames or an iframe? Or do you mean viewing the source code and cutting and pasting? Or do you mean you want to reuse all the body tag? can you elaborate a bit please?
dave
Riverbourgeois
03-26-2003, 11:42 AM
The whole website is written without frames and the body of the menu is written within the body of the page (i.e. the menu and sub-menu items)
so it is something like....
<head>
<link href="Menu.css" rel="stylesheet">
<script language="javascript" src="Menu.js">
</script>
</head>
<body onload.....>
menuitem1 =
menuitem2 =
menuitem3 =
submenu1 =
submenu2 =
</body>
I have left out a lot here, but what I basically want to know is if there is a way to move the menuitem and submenu item code to another file which can be loaded on each page. This way I can change the file once and it affects all pages.
I know I can place it into a frame and have it done that way but I was trying to avoid frames.
Thanks again
barcode
03-26-2003, 11:44 AM
humm if u using frame pages if u put the <body> stuff in the frameset not the actual page it should work
DaveSW
03-26-2003, 11:46 AM
I am not aware of any other way (not that that means much) .
Dave
barcode
03-26-2003, 11:48 AM
its not not much code but frames rnt bad i dont like the way they look wen loading n i know they take a while in first place but when they have loaded the visitor isnt having to load the menu bar n stuff again evry time they change page also u could use layers but they dont work in all explorers IE4+ i think r the 1ns that r capeble of it
Riverbourgeois
03-26-2003, 11:50 AM
ok thanks. I looked for a way around but could not find any. Guess I will have to go the frame route, just wanted to avoid it cause of the page layouts for the main window.
Thanks to all who replied.:D