View Full Version : How Do I: JAVA Script Menu as an Include file?
12-02-2003, 03:35 AM
One problem I have been having is to create some type of an "include" string to pass in our JAVA menu into our web pages. At present, I have had to copy & paste the entire JAVA menu script into each and every web page as we wish to include the JAVA menu system on all pages. Needless to say, this is a real pain every time a change is required in the menu system.
Have been working on creating some type of include string for each page which will load the JAVA menu system from an external file. To date, I have not been successful and find I have to ask for help.
Does anyone know how to accomplish this?
Really would like to thank anyone who would be willing to lend a helping hand.
12-02-2003, 07:56 AM
12-02-2003, 09:10 AM
12-02-2003, 09:24 AM
No worries, I just wanted to verify.
12-02-2003, 09:58 AM
Well, gave it a try and came up with no menu loaded. Just did a copy & paste of your tag as noted to make sure not to have made a typo in the syntax.
In the "menu.js" file, I tried it both with and without the opening & closing script tags. This is the problem I have been having. Am sure it can be done, it's just a case of getting the correct syntax.
12-02-2003, 10:00 AM
Just to make sure - what did you name your JS file & where did you place it?
12-02-2003, 10:32 AM
<link rel="StyleSheet" href="ChMenu00.css" type="text/css">
I did this with a local copy of your page and it seemed to work out okay. The script section in the page where it computes and prints the current date can be left as it is. For more exact reference, the section of the HTML page that you want to take out to place into the menu.js file goes from line 17 to line 261. The menu.js file comes out to about 10k in size, so if the browser caches this file (as it should) it will reduce your bandwidth consumption and your page should load a bit faster.
12-02-2003, 11:02 AM
Worked like a charm. I knew it was a syntax problem, just couldn't seem to get the correct syntax to make it work. Would really like to thank you for your assistance as this will save me a tremendous amount of time down the road.