PDA

View Full Version : Simple Tree Validation Issue



boldyellow
01-02-2008, 11:10 PM
1) Script Title: Simple Tree Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

3) Describe problem: Testing the script on an XHTML 1.0 Transitional page. When a sublist is expanded by default using the attribute <ul rel="open">, the W3C validator indicates that there is no attribute "rel". Is there a suitable workaround for this issue?

SOLUTION FIGURED OUT
The UL tag only allows the attributes "class", "id" and "title" (not "rel"). So I changed "rel" to "title" in the HTML file.
Example:
<ul rel="open"> IS NOW <ul title="open">

I also changed the JS file so any reference to "rel" was now "title".
Examples:
ulelement.setAttribute("rel", "open") IS NOW ulelement.setAttribute("title", "open")
var relvalue=(action=="expand")? "open" : "closed" IS NOW var titlevalue=(action=="expand")? "open" : "closed"