Joshie Surber wrote:
> The only problem I see with it is that it would assign multiple
> elements with the same ID attribute. This is a HUGE (X)HTML no no. You
> could set elem.id to elem.className (or elem.className =
> elem.className + newClassName) instead.
>
Thanks Joshie. I've noticed that using elem.className is too slow,
since I have multiple class names and have to use a regex to extract
the proper one. But point taken about unique ids. I'll probablly just
add a custom property to indicate folderline vs. fileline.
> But other than that the code seems sound. I might, however, point you
> to http://gazingus.org/html/DOM-Scripte...Revisited.html, which
> has a hierarchal tree script that is simply attached to a list. That
> means you would simply have to use basic DOM functions (or even
> innerHTML) to modify the tree contents and ignore the heavy lifting
> altogether.
Interesting ref. It is always nice to see how others do things. At this
point, though, the tree structure is a small part of a lot of code, and
I don't want to switch it out and risk breaking stuff.
> This would also have the advantage of being more usable to
> people with older browsers or JavaScript turned off.
This is for an app where it is okay to have firm browser reqs. I'm
doing a lot of feature sniffing and if the features aren't found, the
app won't work.
BTW = if you are using Google Groups, click the "options" link to reply
with the original message quoted.