以下为引用的内容:
Response.ContentType="text/HTML"
'''''''''''''''''''''''''''''''Server code start'''''''''''''''''''''''''''''''
dim parId,nodeLayer
parid=Request.QueryString("parId")
nodeLayer=cint(Request.QueryString("nodeLayer"))
if(parid="") then
Response.Write("root id can't is null")
Response.End()
end if
if(nodeLayer<0) then
nodeLayer=0
end if
%>
<%
strconn="at"
strsql="select * from tree where par='"&parid&"'"
''SQL 语句书写要求:在记录集的前面三个字段必须依次为:row_id(惟一的主键)、name(菜单条显示的内容)、par_id(父节点row_id),其它根据需要输出与显示
set conn=server.createobject("ADODB.connection")
conn.open strconn
set rs=server.createobject("ADODB.Recordset")
rs.open strsql,conn,3,3
i=0
dim row_id
row_id=""
while not rs.EOF
row_id=rs.Fields("row_id").Value
name=rs.Fields("name").Value
j=0
while j<nodeLayer
Response.Write("<img src='blank.jpg'>")
j=j 1
wend
Response.Write("<img id='objNode"&row_id&"' style='cursor:hand' src='../../open.jpg' onclick=javascript:createChildNode('"&row_id&"',"&nodeLayer 1&") border=0 align='absmiddle'>")
Response.Write("<img src='../../blank.jpg' border=0 align='absmiddle'>")
Response.Write("<a class=item href='../../view.ASP?id="&row_id&"' target='mainFrame'>"&Trim(name)&"</a></br>") '项目内容
Response.Write("<span id='oSpan"&row_id&"' ></span>") '子节点内容区域
i=i 1
rs.MoveNext
wend
'''''''''''''''''''''''''''''''''''''''''Server Code END ''''''''''''''''''''''''''''''''''
%>
---------xtree.js-----------------------------------------------------------------------------
function getChildTree(parId,nodeLayer)
//parId:=夫节点id,nodeLayer:=子节点所属层次
{
var XMLhttp = new ActiveXObject ("Microsoft.XMLHTTP");
XMLhttp.Open("get", "xtree.ASP?parId=" parId "&nodeLayer=" nodeLayer, false);
XMLhttp.Send("Author:taojianbo;Version:2.0");
return XMLhttp.responseText;
}
function showHide(objid)
//显示,隐藏区域,达到菜单显示的目的
//objid:=区域对象ID的parid部分
{
var temp;
eval("temp=oSpan" objid ".style.display");
if(temp=="block")
{
eval("oSpan" objid ".style.display='none'");
|