当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp实现无限级分类的方法js版

ASP
查询翻页优化
强制刷新和判断文件地址
asp缓存类
Byval与Byref的区别
全面认识ASP注入技巧
ubbcode函数
newasp中下载类
[ASP]精华代码
由给定的字符串生成关键字
经验几则
转换中文为unicode 转换unicode到正常文本
在ASP应用程序中限制重复提交同一表单
ASP 程序实现自动升级功能
在ASP编程中使用数组
asp组件编写准备工作
利用AdoDb.Stream对象来读取UTF-8格式的文本文件
把字符串转换成数据库SQL语句格式
access中链接表的问题
access数据库的一些少用操作,ASP,创建数据库文件,创建表,创建字段,ADOX
Asp Access 创建静态文件/HTML

ASP 中的 asp实现无限级分类的方法js版


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 65 ::
收藏到网摘: n/a

MenuArr=new Array()
MenuLenArr=new Array()
SubMenuArr=new Array()
MenuIdArr=new Array()
MenuArr[1]="<%call top11%>" //洲名|||...
MenuArr[2]="<%call top1%>" //洲名###国名|||...
MenuIdArr[1]="zhou"
MenuIdArr[2]="author"
MenuClass=2 //4级菜单
splitchar1="|||";
splitchar2="###";

基本的menuArr[1]与menuArr[2]用类输出
options.add(new Option( "-----请选择-----",""));
add(new Option("text","value"))用法
js生成的value值为top1中的名字,有些用id,有些用文字,在结合数据库select的可行性的原则下修改
sub top1
sql="select * from type2"
rs.open sql,conn,1,1
while not rs.eof
a=rs("id2")
b=rs("p_type2")
call top2(a,a)
rs.movenext
wend
rs.close
end sub
sub top11
sql="select * from type2"
rs.open sql,conn,1,1
while not rs.eof
response.write (rs("p_type2")&"|||")
rs.movenext
wend
rs.close
end sub
sub top2 (id,b)
sqle="select DISTINCT(author) from product where id2="&id
set rsa=server.CreateObject("adodb.recordset")
rsa.open sqle,conn,1,1
if not(rsa.eof) then
while not rsa.eof
response.write (b&"###")
response.write rsa("author")&"|||"
rsa.movenext
wend
else
response.write (b&"###")
response.write "无"&"|||"
end if
rsa.close
end sub
%>