Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: menucontents.js -drop down doesn't link to particular web page

  1. #1
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default menucontents.js -drop down doesn't link to particular web page

    1) Script Title: AnyLink JS Drop Down Menu v2.2
    subhead: Customization of the Drop Down Menu Contents

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem: Using menucontents.js
    Within the drop down content I can't get the link go to a page that is an offshoot of the home (index) pg. why is that? For example,
    ["CNN", "http://www.cnn.com/WORLD/"]
    This will only go to the home page (cnn.com) and not the web page WORLD. Why is that?

    I'm stumped and have searched and searched for an answer to this. it's probably obvious but I'm very NEW to javascript. Many thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm there's no reason why you can have sub directories in your URLs for the menu. In fact, some of the URLs used in the menu demos contain sub directories. Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  3. #3
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, I forgot to give more info.! Sorry about that.

    here is the link to my website (it's a test page I revised from dynamicdrive lesson--the link to that lesson is at the bottom):
    http://www.frankfordfriendsschool.or...micindex2.html

    here is the javascript coding (the other .js and .css files [from lesson] weren't changed).
    PLEASE NOTE: It's only the 2nd link (var anylinkmenu2) that I revised to go to my site's pages:
    About Us (click to reveal)
    var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''} //First menu variable. Make sure "anylinkmenu1" is a unique name!
    anylinkmenu1.items=[
    ["Dynamic Drive", "http://www.dynamicdrive.com/"],
    ["CSS Drive", "http://www.cssdrive.com/"],
    ["JavaScript Kit", "http://www.javascriptkit.com/"],
    ["Coding Forums", "http://www.codingforums.com/"],
    ["JavaScript Reference", "http://www.javascriptkit.com/jsref/"] //no comma following last entry!
    ]


    Code:
    var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
    anylinkmenu2.items=[
    	["History", "http://www.frankfordfriendsschool.org/history/"],
    	["Philosophy", "http://www.frankfordfriendsschool.org/philosophy/"],
    	["Faculty & Staff", "http://www.frankfordfriendsschool.org/staff/"],
    	["Calendar", "http://www.frankfordfriendsschool.org/calendar/"], 
    	["Contact Us", "http://www.frankfordfriendsschool.org/contact/"] //no comma following last entry!
    ]

    var anylinkmenu3={divclass:'anylinkmenucols', inlinestyle:'', linktarget:'secwin'} //Third menu variable. Same precaution.
    anylinkmenu3.cols={divclass:'column', inlinestyle:''} //menu.cols if defined creates columns of menu links segmented by keyword "efc"
    anylinkmenu3.items=[
    ["Dynamic Drive", "http://www.dynamicdrive.com/"],
    ["CSS Drive", "http://www.cssdrive.com/"],
    ["JavaScript Kit", "http://www.javascriptkit.com/"],
    ["Coding Forums", "http://www.codingforums.com/"],
    ["JavaScript Reference", "http://www.javascriptkit.com/jsref/", "efc"],
    ["CNN", "http://www.cnn.com/WORLD/"],
    ["MSNBC", "http://www.msnbc.com/"],
    ["Google", "http://www.google.com/"],
    ["BBC News", "http://news.bbc.co.uk", "efc"],
    ["News.com", "http://www.news.com/"],
    ["SlashDot", "http://www.slashdot.com/"],
    ["Digg", "http://www.digg.com/"],
    ["Tech Crunch", "http://techcrunch.com"] //no comma following last entry!
    ]

    var anylinkmenu4={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#DFFDF4', linktarget:'_new'} //Second menu variable. Same precaution.
    anylinkmenu4.items=[
    ["CNN", "http://www.cnn.com/WORLD/"],
    ["MSNBC", "http://www.msnbc.com/"],
    ["Google", "http://www.google.com/"],
    ["BBC News", "http://news.bbc.co.uk"] //no comma following last entry!
    ]

    lesson's main page:

    there are 2 files from lesson that weren't changed in this lesson:
    anylinkmenu.js
    anylinkmenu.css

  4. #4
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh oh!
    I don't think I did the coding tags accurately! Will this still work?

    I didn't send you the link to the lesson:
    http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    sorry about this.

  5. #5
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    So in your test page, which link within the drop down menu doesn't work?
    DD Admin

  6. #6
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's the 2nd link (var anylinkmenu2) that didn't work. I also tried adding .html to history, philosophy, staff, etc. and that didn't work. For ex: /history.html/
    Below I have them listed w/o .html:

    Code:
    var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'width:150px; background:#FDD271', linktarget:'_new'} //Second menu variable. Same precaution.
    anylinkmenu2.items=[
    	["History", "http://www.frankfordfriendsschool.org/history/"],
    	["Philosophy", "http://www.frankfordfriendsschool.org/philosophy/"],
    	["Faculty & Staff", "http://www.frankfordfriendsschool.org/staff/"],
    	["Calendar", "http://www.frankfordfriendsschool.org/calendar/"], 
    	["Contact Us", "http://www.frankfordfriendsschool.org/contact/"] //no comma following last entry!
    ]

  7. #7
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Looking at the links for that menu:

    Code:
    anylinkmenu2.items=[
    	["History", "http://www.frankfordfriendsschool.org/history/"],
    	["Philosophy", "http://www.frankfordfriendsschool.org/philosophy/"],
    	["Faculty & Staff", "http://www.frankfordfriendsschool.org/staff/"],
    	["Calendar", "http://www.frankfordfriendsschool.org/calendar/"], 
    	["Contact Us", "http://www.frankfordfriendsschool.org/contact/"] //no comma following last entry!
    ]
    The issue is that the links themselves simply don't work, irrespective of the script. For example, try directly going to the first link within the menu- it leads to a 404 page.
    DD Admin

  8. #8
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh dear. I shouldn't have included the history web page. I forgot that's to be developed in the future. Please bear with me and try one of the pages again (I deleted history). I'm so sorry!!

    Again (in coding below) I tried it as:
    http://www.frankfordfriendsschool.org/philosophy/
    and
    http://www.frankfordfriendsschool.org/philosophy.html/
    I would think the link to philosophy.html would work but it didn't. Unless I'm missing something!

    here is same coding but with ".html" added:
    Code:
    anylinkmenu2.items=[
    	["Philosophy", "http://www.frankfordfriendsschool.org/philosophy.html/"],
    	["Faculty & Staff", "http://www.frankfordfriendsschool.org/staff.html/"],
    	["Calendar", "http://www.frankfordfriendsschool.org/calendar.html/"], 
    	["Contact Us", "http://www.frankfordfriendsschool.org/contact.html/"] //no comma following last entry!
    ]

  9. #9
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, is there any way I could get some help on this? I hope it's clear enough now. Please look at my previous email (thread).

    thank you!

  10. #10
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sorry but I must still be missing something. Whether it's:

    http://www.frankfordfriendsschool.org/philosophy/

    or

    http://www.frankfordfriendsschool.org/philosophy.html/

    The issue is the same- the URL simply doesn't work (leads to a 404 page). When you include this link inside the menu, it naturally will also go to a 404 page when clicked on. Are you saying one or both of the above links work for you when you directly enter it into the browser URL bar?
    DD Admin

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
  •