当前位置: 移动技术网 > IT编程>开发语言>Asp > asp实现无限级分类的方法js版

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

2017年12月12日  | 移动技术网IT编程  | 我要评论
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

%>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网