动态载入asp树源码(2)
发布时间:2007-09-06 19:34:00
标签:asp,树
页面 subtree.asp
<%Option Explicit%>
<script language="JavaScript">
function NodeClass(id,Content,strLink,iChildren)
{
//this.id=parseInt(id);
this.id=id;
this.Content=Content;
this.strLink=strLink;
this.iChildren=iChildren;
//this.iChildren=parseInt(iChildren);
}
var ArrNode = new Array();
<%
Dim conn,rs,s,cls,href,Open
Dim nodeid,i
nodeid = Request.QueryString("id")
’On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.mappath("tree/tree.mdb") & ";Persist Security Info=False"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select *,(select count(*) from deeptree where parentid = T.id) as children from deeptree T where parentid=" & nodeid & "",conn,1,3
i=0
Do While Not rs.EOF
%>
ArrNode[<%=i%>] = new NodeClass(<%=rs("id")%>,’<%=trim(rs("content"))%>’,’<%=trim(rs("link"))%>’,<%=rs("children")%>);
<%
i=i+1
rs.MoveNext
Loop
Set rs = Nothing
%>
parent.ArrToHtml(ArrNode,’<% = nodeid %>’);
-->
</script>
<%
Set conn = Nothing
%>
node.htc
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="fos()"/>
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="blu()"/>
<PUBLIC:ATTACH EVENT="onselectstart" ONEVENT="st()"/>
<SCRIPT>
function fos(){
if(style.backgroundColor!=’#ffffff’){
style.color="#000000"
style.border="1 solid #888888"
style.backgroundColor=’#DDDDDD’
}
else
{style.color="#000000"
style.border="1 solid #999999"
style.backgroundColor=’#ffffff’
}
}
function blu(){
if(style.backgroundColor!=’#ffffff’){
style.color="#000000"
style.border="1 solid #f2f2f2"
style.backgroundColor=’#f2f2f2’
}
else
{style.color="#000000"
style.border="1 solid #999999"
style.backgroundColor=’#ffffff’
}
}
function st(){
return false;
}
</SCRIPT>
</PUBLIC:COMPONENT>
样式页面 style.css
body{font-size:12px}
#txt{font-size: 12px; color: #000000; font-family: Courier New;border:1 solid #3366cc}
#hrf{font-size: 12px; color: #000000; font-family: Courier New;border:1 solid #3366cc}
#sb{font-size: 12px; color: #000000; font-family: Courier New;background-color:#d2e8ff;border:1 solid #3366cc;cursor:hand}
.node{position:relative;left:2;height:20;padding:3 3 1 3;font-size:12px;font-family: Courier New;cursor:hand;border:1 solid #f2f2f2;behavior:url(css/node.htc)}
.load{position:relative;left:2;height:20;padding:1 3 1 3;font-size:12px;font-family: Courier New;cursor:hand;border:1 solid #999999;background-color:#f2f2f2;color:#999999}
.td_node{height:22px}
#treedir{
}
span.diropen
{ padding-left:2px;
overflow:hidden;
line-height:3px;
font-size:12px;
padding-top:5px;
width:11px;
height:11px;
border:solid 1px black;
background-color:#ffffff;
cursor:hand;
}
span.dirclose
{
line-height:6px;
font-size:9px;
overflow:hidden;
padding:2px;
width:11px;
height:11px;
border:solid 1px black;
background-color:#ffffff;
cursor:hand;
}
.dirNode
{
font-weight:bold
overflow:visible;
font-size:9px;
line-height:3px;
padding: 1px 1px 0px 3px;
width:11px;
height:11px;
border:solid 1px black;
background-color:#ffffff;
cursor:hand;
}


猜你喜欢
- django {% url %} 模板标签使用inclusions/_archives.html...{% for date in date
- 1、说明Python实现异步IO非常简单,asyncio是Python 3.4版本引入的标准库,直接内置了对异步IO的支持。asyncio的
- sql不常用函数总结以及事务,增加,删除触发器 distinct 删除重复行 declare @x 申明一个变量 convert(varch
- WEB程序员的技能要求: Web程序员不光要对 后端程序(如 php,jsp,asp.net)语言知识,对程序设计架构知识,数据库
- 原理形态学是图像处理中常见的名词,图像处理的形态学基本属于数学形态学的范畴,是一门建立在格论和拓扑学基础上的图像分析学科。黑帽运算是结合了腐
- #小策略,策略逻辑是在金叉时候买进,死叉时候卖出,所谓金叉死叉是两条均线的交叉,当短期均线上穿长期均线为金叉,反之为死叉#下面是策略代码及结
- 问:怎样才能指定MySQL只监听某个特定地址?答:比较常见的办法是,在my.cnf之mysqld节,添加bind-address=127.0
- 使用php就不一样了,php包含了zlib的链接库,可以直接使用其相关功能,下面是我写的压缩和结压缩swf文件的例子: //没有加入判断sw
- 人丑就要多读书,颜值不够知识来凑,至少你可以用书籍来武装你的大脑,拯救你的人生。TIOBE编程语言排行榜前20的语言入门书籍推荐
- PyQt是Qt框架的Python语言实现,是最强大的GUI库之一。PyQt提供了一个设计良好的窗口控件集合,具有更方便的操作性。学过VB的同
- 第一招、mysql服务的启动和停止net stop mysqlnet start mysql第二招、登陆mysql语法如下: mysql -
- <1>IsArray 函数 返回 Boolean 值指明某变量是否为数组。 语法 IsArray(var
- 经常在工作中会使用到XPath的相关知识,但每次总会在一些关键的地方不记得或不太清楚,所以免不了每次总要查一些零碎的知识,感觉即很烦又浪费时
- 最近研究微信API,发现个非常好用的python库:wxpy。wxpy基于itchat,使用了 Web 微信的通讯协议,实现了微信登录、收发
- Python列表List(列表) 是 Python 中使用最频繁的数据类型。列表可以完成大多数集合类的数据结构实现。它支持字符,数字,字符串
- 在用Python开发时(Windows环境),会碰到需要安装某个版本的第三方库,为了以后查找、安装方便,总结如下:windows版的各种Py
- 在java的应用中,我们经常会对数据库进行必要的操作,下来我们就了解一下如何用java连接mysql数据库 以及java连接sql serv
- 在python里面,读取或写入csv文件时,首先要import csv这个库,然后利用这个库提供的方法进行对文件的读写。典型的数据集stoc
- lambda/filter/map/reduce这几个函数面试中很肯定会用到,本篇主要介绍这几个函数的用法。1 lambda匿名函数,用法如
- 减少HTTP请求,是可以提高网站速度的,把所有的背景图像都放到一个图片文件中,然后通过CSS的background-image和backgr