asp+sql做目录树如何实现(无限极)
getObjectById("TimeShow").innerHTML = "加载本页耗时 "+ (new Date().getTime()-t1) +" 毫秒";
}
</SCRIPT>
</head>
<body>
<h3>梅花雪WEB脚本控件集 - MzTreeView 1.0 树 - 测试页面</h3>
<form method="get" style="padding: 3; background-color: #B8D1F8; margin-bottom: 0">
<fieldset>
<legend>输入树节点参数信息</legend>
树的总节点数:<input name="total" size='8' maxlength='8' value="1024">
每节点的子节点数:<input name="childNodes" size='3' maxlength='3' value="10">
<input type="submit" value="确定">
</fieldset>
</form>
<table width="100%" border=0 cellspacing=3 bgcolor="#B8D1F8">
<tr>
<td bgcolor=white valign=top>
<div id=treeviewarea style="background-color: "></div>
<SCRIPT LANGUAGE="JavaScript">
<!--
var tree = new MzTreeView("tree");
tree.setIconPath("./");
tree.nodes['0_1'] = 'text:节点 1';
tree.nodes['1_2'] = 'text:节点 2';
tree.nodes['1_3'] = 'text:节点 3';
tree.nodes['1_4'] = 'text:节点 4';
tree.nodes['1_5'] = 'text:节点 5';
tree.nodes['1_6'] = 'text:节点 6';
tree.nodes['1_7'] = 'text:节点 7';
tree.nodes['1_8'] = 'text:节点 8';
tree.nodes['1_9'] = 'text:节点 9';
tree.nodes['1_10'] = 'text:节点 10';
var tot = getQuery("total"); tot = !tot || isNaN(tot) ? 1024 : tot;
var cns = getQuery("childNodes"); cns = !cns || isNaN(cns) ? 10 : cns;
with(document.forms[0])
{
total.value = tot;
childNodes.value = cns;
}
for (i=11; i<tot; i++)
tree.nodes[Math.floor(Math.random()*(tot/cns))+2 +"_"+ i] = 'text:节点 '+ i;
document.getElementById('treeviewarea').innerHTML = tree.toString();
if(typeof(Function.prototype.apply)!="function")
{
Function.prototype.apply = function(obj, argu){var s; if(obj){obj.constructor.prototype._caller=this; s = "obj._caller";} else s = "this"; var a=[]; for(var i=0; i<argu.length; i++) a[i] = "argu["+ i +"]"; return eval(s +"("+ a.join(",") +");");};
Function.prototype.call = function(obj){var a=[]; for(var i=1; i<arguments.length; i++) a[i-1]=arguments[i]; return this.apply(obj, a);};
}
tree.buildNode = function(id)
{
var d = new Date().getTime();
MzTreeView.prototype.buildNode.call(this, id);
try{
getObjectById("TimeNode").innerHTML = "<u><b>"+ this.node[id].text +"</b></u> 有 "+
this.node[id].childNodes.length +" 个子节点<br>加载耗时:"+ (new Date().getTime()-d) +" 毫秒!";
}catch(e){}
}
tree.expandAll = function()
{
var d = new Date().getTime();
MzTreeView.prototype.expandAll.call(this);
alert("全部展开耗时 = "+ (new Date().getTime()-d) +
" 毫秒!\r\n有效节点总数 = "+ (this.index+1));
}
//-->
</SCRIPT>
</td><td width="230" valign=top>
·<u><a href="http://www.meizz.com/Web/Article.asp?id=436" target="_blank">使用说明</a></u><br>
·<u><a href="http://www.meizz.com/Web/Download/MzTreeView10.rar" target="_blank">下载 MzTreeVew V1.0</a></u><br><br>
聚焦到<input id=focusId size=5>节点<input type=button value="聚集" onClick="tree.focus(getObjectById('focusId').value)"><br>
<input type=button value="父层节点←" onClick="tree.upperNode()"><input type=button value="子层节点→" onClick="tree.lowerNode()"><br>
<input type=button value="上一节点↑" onClick="tree.pervNode()"><input type=button value="下一节点↓" onClick="tree.nextNode()"><br>
<input type=button value=展开所有节点 onClick="tree.expandAll()"><br>
<br><ul style="line-height: 14pt">
<li id=msgNode >1024 个节点的树!
<li id="TimeShow" style="color: #0000D0">在这里可以看到每个节点加载的耗时
<li id="TimeNode">
</ul></td>
</tr>
</table>
</body>
</html>
补充:asp教程,高级应用