SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Invalid tag? Dreamweaver keeps overwritting!

    I have been using a script for a navigational menu.

    The problem is that dreamweaver insists the below tag is invalid.

    <ul id="foldinglist" style="display:none" style=&{head};>
    When i save the page - dreamweaver changes the tag to this.

    <ul id="foldinglist" style="display:none">
    I know there is a way to stop dreamweaver doing this but i would like to keep the clean up html default option when saving files for other reasons. So...
    Can anyone tell me what is wrong with <ul id="foldinglist" style="display:none" style=&{head};> ?

    Because dreamweaver changes the code - the result is that the script does not work properly in some browsers.
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    The problem with it is that its not valid code.

    You can't have two style declarations in the same inline style.

    Quote Originally Posted by w3c
    Line 11, column 48: duplicate specification of attribute "style" (explain...).
    <ul id="foldinglist" style="display:none" style=&{head};>
    ^
    Line 11, column 48: an attribute value must be a literal unless it contains only name characters (explain...).
    <ul id="foldinglist" style="display:none" style=&{head};>
    Also style=&{head}; isn't valid on its own either and I assume its something to do with your javascript function.

    You could probably put the first style in the head of the document:
    Code:
    <style type="text/css">
    #foldinglist {display:none}
    </style>
    Then DW would probably leave the other style tag alone.

    However, I should look for some better validating scripts for drop down menus if I were you. I think you are using an old dynamic drive script that has incorrectly nested lists, misuses the id by using it more than once and uses invalid inline styles.

    have a look here fo some more compliant dropdown menus.

    http://www.gazingus.org/

    http://www.alistapart.com/articles/dropdowns/


    Hope that helps.

    Paul

  3. #3
    Object Not Found junjun's Avatar
    Join Date
    Mar 2002
    Location
    northern MI
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TimNiceButDim
    Because dreamweaver changes the code...
    Edit->Preferences->Code Rewriting

  4. #4
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul... this is the menu script i am using - http://www.hostcompanies.com/menutest2.htm ( with dreamweaver scraping the invalid code ). I want to change from my current tree menu - www.hostcompanies.com. The reason for the change is that my current menu is code heavy and slows down the page.

    I have been looking for an alternative tree menu to use but the problem is that most tree menus do not allow for the links in the menu to be crawlable. This means that search engines would not index the links in the menu.

    I have been trying to convert a script at dynamic drive - http://www.hostcompanies.com/menutest2.htm to solve the problem.

    Paul... is the script i am trying to use really that bad? It appealed to me because it was fast, crawlable by the search engines and should turn into a bullet list in not compliant browers ( but it only degrades with the original non valid code in older browsers ).

    You can see the original script here - http://www.dynamicdrive.com/dynamicindex1/navigate1.htm.
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Paul... is the script i am trying to use really that bad?
    Well it looks bad to me from an html point of view (but I avoid javascript so I can't tell you about that).

    The lists are wrongly constructed in that the sublists should be within the <li> tag and not outside it. Also an id should be unique to the page but its been used more than once in their example.

    If you don't care about these things then use it. Doing what I suggested above should stop dw re-writing the code. Otherwise turn off code re-writing for that page like junjun suggested.

    Alternatively look at those 2 links I gave you which come highly recommended by zeldman and a list apart.

    Paul
    Edit:


    Just checked your link with dw editing the code and the menu seems to work ok!

    Edit:


    Moving the style to the head doesn't work so you will need another solution. Also note that if javascript is turned off your uses can't go anywhere at all.

  6. #6
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The menu does work ok but once dreamweaver strips the code, the bullet list will not dispaly properly in early versions of netscape.
    Even with javascript turned off, the menu should just change to a bullet list.
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Even with javascript turned off, the menu should just change to a bullet list
    Yes but the sub menus are all hidden as they are set to display:none inline. TRy it in firefox and turn javascript off to see what I mean.

    Paul

  8. #8
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't have firefox... is there a simple fix to this?
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  9. #9
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by junjun
    Edit->Preferences->Code Rewriting
    in my experience, that doesn't always solve the problems with DW MX (not sure if MX2004 is better in this respect). i've got everything turned off on mine, and it often still rewrites stuff silently (heck, it doesn't even show the change until i close a document and then reopen it). many a time i've had to save a file, open it with another text editor, make it valid again, then just use DW to FTP it over, making a mental note not to open/save it again in there...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  10. #10
    Object Not Found junjun's Avatar
    Join Date
    Mar 2002
    Location
    northern MI
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm redux, I got MX too, and works fine here.
    Is your DW up to date with patches etc?

  11. #11
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know if there is a way to write <ul id="foldinglist" style="display:none" style=&{head};> and make it valid code?
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  12. #12
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi TimNicebutDim,

    Just a thought but have you tried adding the invalid markup into one style tag.

    e.g.
    Code:
     <ul id="foldinglist" style="display:none;&{head};">
    It makes invalid css instead but dw won't re-write it. It seems to work like this and the menu expands ok in firefox and ie6. In NN4.7 the menu starts opened with all options visible which I assume is what you wanted.

    I believe the javascript goes throght and sets the &head; to display:block for NN4 (but javascript is not my thing).

    Hopefully someone else can offer a valid javascript alternative

    Alternatively I'm sure those links I gave you can do the same job in a more standards way.

    If javascript is disabled then you should offer a sub menu in the <noscript> tags so that people can still navigate.

    Paul

  13. #13
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Third Stone From The Sun
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use Valid Code!

    Hi,

    The first problem is that you are using a script which relies on invalid code. You can never have two of the same attribute (you used style).

    Gazingus.org script is based around standards. If you want more features and standards compliance (cookie persistence, animation), you can check mine out. It's priced with an affordable range of license types and comes with support.

    Here -> http://dhtmlkitchen.com/scripts/animtree/
    My outdated site is down for a while now.

  14. #14
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to make your tree load all the nodes and links straight away?

    I noticed that it loads them as you click on the nodes and hover the links ... thats one thing i dislike about it.

    Can you have several levels of sub menus?
    Like... Heading... sub heading... sub sub heading... ?
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  15. #15
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like a nice script but you have a problem with your demos.

    I am using IE6 - try clicking a few of the nodes in the demos. You will receive this error message - and you cannot naviagte the nodes after.

    Line 37
    Char 107
    IE5 is undefined
    Code 0
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  16. #16
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    London, UK
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would seriously buy this script if you managed to fix this error in the demos. In IE6 after the error the menus close and you cannot nagivate any of the links.
    Add your web design / hosting companies to my directory - Web Hosting Directory
    Want to join our panel of experts? - Hosting Forums ( top right of forums -expert drop down box for more info ).

  17. #17
    SitePoint Member
    Join Date
    Nov 2003
    Location
    Minnesota
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tree Menu Magic by Project Seven might do what you need. It offers unlimited submenus, display for non-javascript browsers (which I assume would include search engines), and CSS-based styles.


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
  •