Results 1 to 5 of 5

Thread: Javascript Navigation Menus

  1. #1
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Javascript Navigation Menus

    I have a website that I have created javascript menus for and I wanted to put the menus in a seperate file so that when it comes time to edit the menu I dont need to edit all of my html files just that one.

    I have this code
    <SCRIPT LANGUAGE="JAVASCRIPT" SRC="java.js"
    TYPE="TEXT/JAVASCRIPT">
    </SCRIPT>

    to my understanding this is what i would use to refer my menu to the source. but my menu system isnt relizing where the source is, it still thinks it still in the html file itself. my menu
    <div id="globalNav">
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()">12 Volts </a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()">Audio </a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu3, '150px')" onMouseout="delayhidemenu()">Security</a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()">Mobile Theater</a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu5, '150px')" onMouseout="delayhidemenu()">Remote Starters</a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu6, '150px')" onMouseout="delayhidemenu()">Performance</a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu7, '150px')" onMouseout="delayhidemenu()">In-Car Computing</a> |
    <a href="#"><a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu8, '150px')" onMouseout="delayhidemenu()">Wireless</a> | <a href="forums.html"> Forums</a></div>
    </div>

    Please some help me, I am planning a big website I if for some reason I need to change my menu I dont want to change all of my pages!

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There should be no problem with this, so long as your Javascript file is named "java.js" and is in the same directory as the webpage. If it's saying that the file cannot be found and/or the functions don't exist, try clearing your browser cache - the page might have got stuck.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation java

    I put the code exactly as it was on the html page itself and then put it in a java file named "java.js" then put that same code for the menu on page then the code on the page should call up "java.js" on demand but it doesnt when i open the page it has errors but when i check for errors dreamweaver says there isnt any! im lost to what i should do.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Are you sure you put only the Javascript in the file, not the <script></script> tags as well?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile script

    hey thanks for your help i did of the tags in the file also i removed them and it was fine after that.

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
  •