A relatively simple page, similar to the left list of the CSDN forum under the NS
describe:
1. 1.
Data name: tree.mdb
Table name: Tree
Table structure: ID (self -edited) PID (number) content (text) link (text)
2.
Photo: Endnode.gif CollapSed.gif Back.gif (both in the IMG directory, you can modify it by yourself)
3..
Code:
<!-#Include file = "conn.inc "->
<Html>
<Head>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Meta name = "general" content = "microsoft FrontPage 4.0">
<Title> Unlimited List </Title>
<!--
by Fason (2003-5-12)
->
<Style>
.Node {
font-size: 12px;
padding: 0 0 2 0;
margin-left: 10;
height: 22px;
}
img {
vertical-Align: MIDDLE;
width: 11px;
height: 11px;
}
a {Text-decoration: None; FONT-SIZE: 12px; Color: BLACK}
.deeptree {
width: 100%;
height: 100%;
backgound-color:#f2F2F2;
overflow: Auto;
}
</style>
</Head>
<Body bgcolor =#F2F2F2>
<nobr>
<div>
<%
newid = request.querystring ("ID")
if newid = "" or cint (newid) <0 thatn newid = 0
if isnumeric (newid) then
listtree (cint (newid))
end if
Function listree (ID)
DIM RS
DIM Imgfolder, Imgfile
dim link, href, painthref
DIM TARGET, Ahref, CLICK
Target = "main" 'specified framework name
imgfolder = "IMG/" 'default path
set rs = conn.execute ("Select count ( *) from tree where pid = T.ID) as children, (Select pid from tree where ID =" & ID & ") AS Parent from TREE TREE P ID = " & ID)
if not rs.eof then
Parenthref = Request.servervariables ("url") & "? ID =" & rs ("paint")
if ID <> 0 the response.write "<div class = 'node' nowrap = true> <a href = '" & parenthref & "' onFocus = 'Blur ()'> <IMG SRC = '& IMGFOLDER & "back.gif' border = 0> </a> <A href = '"& Parenthref &"'> Previous Catalog </a> </div> "& VBCRLF
do while not rs.eof
if rs ("Children")> 0 then
img = imgfolder "collapset.gif"
href = request.servervariables ("url") & "? ID =" & rs ("ID")
click = "OnClight =" "Location.href = '" & HREF & "'" ""
else
img = imgfolder "endnode.gif"
href = "javascript: void (0)"
end if
if not isnull (rs ("link") then
Ahref = RS ("LINK")
else
ahref = "javascript: void (0)"
target = "_ Self"
end if
Link = "<A href = '" & ahref & "' target = '" & target & "' title = '" & rs ("content") & "'" & click & ">" "content") & "</a>" </a>
Response.write "<div class = 'node' nowrap = true> <a href = '" & href & "' onFocus = 'Blur ()'> <img src = '" & img & "' border = 0> </a>" " & link & "</div>" "
rs.movenext
loop
RS.Close: Set RS = Nothing
end if
end function
conn.close: set conn = Nothing
%>
</div>
</nobr>
</Body>
</Html>
conn.inc:
<%
dim conn
set conn = server.createObject ("Adodb.connection")
conn.open "provider = microsoft.jet.OLEDB.4.0; data source =" & server.mappath ("tree.mdb") & "; Persist Security info = false" "
%>
4. Test: IE6, NS7, Mozilla Under the test and passed through