PDA

View Full Version : Umm html Error?



bluewalrus
10-08-2008, 01:18 AM
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.

Jesdisciple
10-14-2008, 09:35 PM
FYI, detecting IE with document.all (http://javascript.about.com/od/hintsandtips/a/worst_4.htm) is a bad practice.

The only inconsistency I find is that this:
#nav li:hover ul, li.over ulisn't this:
#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.
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(' ');
}
}
}
}
}

bluewalrus
10-15-2008, 01:12 AM
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.

Jesdisciple
10-15-2008, 02:23 AM
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.)

bluewalrus
10-15-2008, 03:12 AM
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.

Jesdisciple
10-15-2008, 04:01 AM
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 (http://jslint.com/).

bluewalrus
10-15-2008, 05:19 AM
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...

Jesdisciple
10-15-2008, 07:36 AM
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 (http://forums.mozillazine.org/viewforum.php?f=9) 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.

bluewalrus
10-15-2008, 01:35 PM
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.