asp实现无限级分类的方法js版
程序员文章站
2024-01-28 19:42:46
menuarr=new array()menulenarr=new array()submenuarr=new array()menuidarr=new array()me...
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="###";
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
%>
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
%>
上一篇: javascript简单链式调用案例分析
下一篇: jQuery拼图小游戏