Results 1 to 2 of 2

Thread: external menu file help

  1. #1
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default external menu file help

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •