Results 1 to 9 of 9

Thread: Umm html Error?

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default Umm html Error?

    I thought this was a css issue but no one there has awnsered it so maybe that means it not? Basically the mouseovers not working on the blogs link in this page http://www.travelinchucks.com/ . Its suppose to work like the suckerfish http://www.alistapart.com/articles/dropdowns/ . It works every like 3rd time. Thanks for any suggestions or ideas you have.
    Last edited by bluewalrus; 10-08-2008 at 01:24 AM.

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    FYI, detecting IE with document.all is a bad practice.

    The only inconsistency I find is that this:
    Code:
    #nav li:hover ul, li.over ul
    isn't this:
    Code:
    #nav li:hover ul, #nav li.over ul
    Other than that, I see no problems whatsoever in your code. If the links' style is that important to you, all I can suggest is a warning to not view the page in IE.

    EDIT: I don't think this will help, but try using it instead of your current JS. It makes sure a space doesn't lead the first class name.
    Code:
    window.onload = function() {
        if (document.all&&document.getElementById) {
            navRoot = document.getElementById("nav");
            for (i=0; i<navRoot.childNodes.length; i++) {
                node = navRoot.childNodes[i];
                if (node.nodeName=="LI") {
                    node.onmouseover=function() {
                        var classes = this.className.split(' ');
                        classes.push('over');
                        this.className = classes.join(' ');
                    }
                    node.onmouseout=function() {
                        var classes = this.className.split(' ');
                        for(var i = 0; i < classes.length; i++){
                            if(classes[i] == 'over'){
                                classes.splice(i, 1);
                            }
                        }
                        this.className = classes.join(' ');
                    }
                }
            }
        }
    }
    Last edited by Jesdisciple; 10-14-2008 at 10:02 PM.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    oo thanks for your response i actually had rewritten the whole code though at this point. I forgot i had this forum started in here as well. That java doesn't validate nor does the one that i got in the css forum. But the one there functions in both ie Firefox and safari so I'm happy with it.

  4. #4
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    I modified the JavaScript to so it works in Firefox, and I receive no errors. What does IE complain about? (I'm running Linux so IE is off-limits for me.)
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    http://validator.w3.org/ Wouldn't validate it.
    I'm on a mac so I can't actually test any IE stuff i only have ie5.2.
    The js was specifically for ie only though.

  6. #6
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    The W3C validator "checks the markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc." This doesn't include JavaScript. If you want something to check a script's syntax and "best practice" adherence (but not effects), try JSLint.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    That jslint is closing all of my open tabs in firefox whenever i open it. I don't recommend anyone click that. I just lost 8 other tabs...

  8. #8
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    Much of the JavaScript community can verify that JSLint is not malicious, and it works for me. Please start a thread with all relevant details in Firefox Support at forums.mozillazine.org (http://forums.mozillazine.org/viewforum.php?f=38 if you still trust my links).

    If no valid explanation is given for why Firefox should/must do that, proceed to the Firefox "bug writing guidelines" (http://developer.mozilla.org/en/Bug_writing_guidelines). I'm guessing DD wouldn't prohibit you from asking for help in this thread, and of course your mozillaZine thread will also work.
    Last edited by Jesdisciple; 10-15-2008 at 07:42 AM. Reason: switched to Firefox Support because it sounds like a memory issue
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  9. #9
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    don't know where I'd put it here. i dont want to join that other forum just to report one error. Firefox should have an option to report bugs/errors.

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
  •