Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2005
    Location
    Winchester, KY
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Menu with external javascript or similar

    I need a menu that accesses an external javascript file (or other type) for the contents of the menu. That is, When I add a link to my menu, I only want to have to add it once, in an external file that every page uses for the menu items. I know there was one on Dynamic Drive before, but i can't find one now. Does anyone know of any suggestions?
    And the forests will echo with laughter...

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well it depends.

    Do you just want a series of links on same line/different line?

    Or do you want one of the "all singing all dancing" menus?

    If its the first, you would just save the file as filename.js, with no <script> </script> tags in it. For example the following is a example of external .js file

    Code:
    document.write("hello<br>");
    document.write("my name is ....... !");
    Then to link that into a file, you simply do

    Code:
    <script src="filename.js"></script>
    Then when you want to edit the menu/whatever you just update filename.js

    Hope this helps

  • #3
    New Coder
    Join Date
    Feb 2005
    Location
    Winchester, KY
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think I get it, thanks for the help.
    And the forests will echo with laughter...


  •  

    Posting Permissions

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