views:

22

answers:

0

I`ve tried to make an animated file tree using this

Ive used the way without jQuery. But the list is getting long and I thought that may use ajax to call a php script and then to add the output of it to the tree. But it dosnt work. I`ve changed the php_file_tree.js

while (1) {
    if (node != null) {
        if (node.tagName == "UL") {
            var d = (node.style.display == "none")
                node.style.display = (d) ? "block" : "none";
                this.className = (d) ? "open" : "closed";
                xmlHttp=GetXmlHttpObject()
                if (xmlHttp==null) {
                    alert ("Browser does not support HTTP Request")
                    return
                }
                var url="show.php"
                url=url+"?folder="+this.innerHTML
                xmlHttp.open("GET",url,true)
                xmlHttp.send(null)
                xmlHttp.onreadystatechange = stateChanged()
                return false;
        }    
            node = node.nextSibling;
    } else {
            return false;
    }
}
function stateChanged(id) { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 node.innerHTML=xmlHttp.responseText 
} 
}

the problem seems to be in the function, but I really don`t know how to fix it.