Results 1 to 7 of 7

Thread: AnyLink Vertical Menu - Please help!!

  1. #1
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy AnyLink Vertical Menu - Please help!!

    1) Script Title: AnyLink Vertical Menu

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

    3) Describe problem: I have posted this problem before, but received no response. So I have uploaded the relevant pages to my website, so some kind soul out there can see what happens with this drop down menu. The page can be found at: http://www.sgconsulting.co.za/Testsite/Index.htm

    The menu looks fine and works fine when I use the drop down to navigate to other pages. The problem comes when I try to move away from the target page. Part of its address becomes inserted into the URL of the next page one tries to move to, making all further navigation impossible.

    Does anyone have any idea what is causing this? I assume I screwed up the code in the AnyLink Menu somehow, but I simply don't know enough about coding to figure out where the fault lies.

    Pleeeeeeease Help!!!!

  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

    That problem is because you are using the relative path in the menu code, example:

    menu1[0]='<a href="Products/BatchMixer/BatchMixer.htm">Batch Mixing</a>'

    which is fine if you are in the /Testsite/ directory because there it means:

    /Testsite/Products/BatchMixer/BatchMixer.htm

    but if you are already in, say - the /Testsite/Products/Reactor/ directory, it means:

    /Testsite/Products/Reactor/Products/BatchMixer/BatchMixer.htm

    which doesn't exist. Now I don't know how the menu code is getting on those pages, if it is via an include of some sort, best to use the absolute path:

    menu1[0]='<a href="http://www.sgconsulting.co.za/Testsite/Products/BatchMixer/BatchMixer.htm">Batch Mixing</a>'

    If it is hard coded onto each page, you can still use the absolute path or, just make sure each link does point to a real page.

    Now, you have another problem that you may not even be aware of. Only a Microsoft product like IE or Word, etc. knows what this means:

    Code:
    <!--[if !mso]>
    To all other browsers it looks like the beginning of an ordinary HTML comment. This would be fine except that everything after that until this:

    Code:
    <![endif]-->
    gets skipped so, your menu that could work in other browsers will not.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much, John. I will alter the addresses and see if that gives me any joy.

    I thought that the microsoft coding is in the script to allow it to work with IE. The way I understood the explaination of the coding, this part is ignored by other browsers, but has to be read by IE to allow the menu to work properly.
    Did I misunderstand this?

    Cheers

    Nils

  4. #4
    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

    Well, you have the right idea about conditional comments but you have implemented it in a way that, though logical for MS products, will result in exactly the situation I described in all other browsers.

    The mistake you've made is in shielding one MS application from the code and allowing another MS application access to the code inside the conditional. This works fine as long as only programs that understand the condition are used with the file. However, of all the browsers in use today only IE4 and above understand the condition.

    The way the conditional is supposed to be used for live HTML pages is to allow IE (sometimes only certain versions of IE) and deny all others access to a code segment.

    What you have breaks down like so in IE:

    IE is parsing the document, it sees:

    Code:
    <!--[if !mso]>
    It 'thinks' - Um this is a comment, oh no it is a conditional comment, let's see it says "If you are not MS Office, read the following code", OK, I'm not MS Office, so I'll read this code.

    Then when it gets to:

    Code:
    <![endif]-->
    IE goes like - Phew, now I don't have to worry about wether or not I am MS Office, I can just proceed normally.

    However, all other browser do it this way:

    When they get to the first one, they think - ah, a comment, I'll stop reading until the comment is closed.

    Then when they get to the second one - time to start reading again.
    Last edited by jscheuer1; 07-14-2006 at 03:17 PM. Reason: spelling/grammar
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi again, John

    Thanks again for your help.

    OK, clear as mud so far - that sound you hear is my head bouncing repeatedly off my desk.

    I have checked the code for the menu as I originally set it up, and compared it to that which appears on the pages I copied it to. The <!--[if !mso]> part does not appear in the original menu, so I can only assume that it is something added in by Front Page. I certainly don't know enough about this to have done it on purpose :-)).

    Can I simply delete the code segments or am I totally screwed here?

    Cheers

    Nils

  6. #6
    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

    FP has a habit of doing that sort of thing. That's one reason why I use a text editor to do coding. If you are going to load the page into FP ever again at any time, best to open it up first in notepad and replace:

    Code:
    <!--[if !mso]>
    with:

    Code:
    <!--webbot bot="HTMLMarkup" startspan -->
    and replace:

    Code:
    <![endif]-->
    with:

    Code:
    <!--webbot bot="HTMLMarkup" endspan -->
    and save. That way FP won't mess with that part anymore and all browsers will read the code between them as, these new comments appear as two separate, self contained comments.
    - John
    ________________________

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

  7. #7
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Right! Looks like I have some work to do. Great to find someone who knows what he is doing and is prepared to help. Thanks a stack!

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
  •