File: javascript/tree.js

Recommend this page to a friend!
  Classes of Roberto M.  >  Tree AJAX  >  javascript/tree.js  >  Download  
File: javascript/tree.js
Role: Auxiliary data
Content type: text/plain
Description: Funtion that show/hide layers and call the Ajax object
Class: Tree AJAX
Show a tree of nodes opened dynamically with AJAX
Author: By
Last change:
Date: 14 years ago
Size: 917 bytes


Class file image Download

		// Funtion that show/hide layers and call the Ajax object
		function loadTree(id){
			if (document.getElementById("c"+id).style.display=="none"){

			if(document.getElementById("c"+id).innerHTML == ""){
				document.getElementById("c"+id).innerHTML="loading...";  // place to insert a preloading icon .... web2.0 like

				target = document.getElementById("c"+id);
				var myConn = new XHConn();
				if (!myConn) alert("XMLHTTP not available. Try a newer/better browser.");
				myConn.connect("tree_sub.php", "POST", "id="+id, showTree);
			} else {

		// Funtion whenDone XHConn is complete
		showTree = function(oXML) {
			target.innerHTML = oXML.responseText;
			if(oXML.responseText == "")"none";

For more information send a message to info at phpclasses dot org.