I found the following script in the Scripts help forum:
I am using it on the following page:Code:<script type="text/javascript"> if(document.getElementById) document.write('<style type="text/css"> .vertical li ul {display: none;} <\/style>'); </script>
http://www.flimpact.org/testmenu.html
It works perfectly and makes it so the submenu items don't appear when a page loads.
However, it's causing validation errors and I have no idea to alter the script without making it not work.
Here are the errors from the validator at W3.org:
If I remove the code, the page validates perfectly with no errors.Code:Line 27, Column 98: document type does not allow element "style" here. …ocument.write('<style type="text/css"> .vertical li ul {display: none;} <\/st Line 27, Column 133: character "<" is the first character of a delimiter but occurred as data. …s"> .vertical li ul {display: none;} <\/style>'); </script> Line 27, Column 154: end tag for "style" omitted, but OMITTAG NO was specified. …display: none;} <\/style>'); </script> Line 27, Column 76: start tag was here. …ment.getElementById) document.write('<style type="text/css"> .vertical li ul Line 27, Column > 80: XML Parsing Error: StartTag: invalid element name. ….getElementById) document.write('<style type="text/css"> .vertical li ul {dis… Line 27, Column > 80: XML Parsing Error: Opening and ending tag mismatch: style line 27 and script. ….getElementById) document.write('<style type="text/css"> .vertical li ul {dis… Line 42, Column 7: XML Parsing Error: Opening and ending tag mismatch: script line 27 and head. </head> Line 209, Column 7: XML Parsing Error: Opening and ending tag mismatch: head line 3 and html. </html> Line 209, Column 7: XML Parsing Error: Premature end of data in tag html line 2. </html>
Thank you in advance,
Deborah



Reply With Quote


Bookmarks