PDA

View Full Version : external menu file help



matthew.pringle
11-23-2007, 10:43 PM
I am a complete novice when it comes to javascript - i usually limit myself to adapting other peoples scripts but i am building a website and want to load the menu from an external file.

the .js file is already external but i want to load the html part detailing the actual links from an external file rather than place it on each page. it has been suggested i use an <!--#include file="xxx" --> command but i know nothing about it and fiddling did not produce the required results. can anyone help?

Thanks

Matt

jscheuer1
11-24-2007, 06:31 AM
Includes require some sort of server side code on the host. Each host (I have no idea about your particular host) has their own setup as regards these languages and usually a tiered system whereby the more you pay for service, the more languages are available. Many free hosts provide no server side language support, though some do.

What you would need to do is to determine what, if any server side languages (like PHP, asp, FP extensions, etc.) are available to you. If there are any, pick one. PHP is perhaps the best from the point of view of receiving generic support on a forum like this one. But you will ultimately have to go with one that is available. Fortunately the include process (though generally done in a specific way in each server side language) is a pretty basic operation in any of them.

Includes are best used for HTML code only, use <link> tags for external style and <script> tags for external scripts.