jsp+javascript打造级连菜单
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"c pageencoding="gb2312"
%>
<style>er%K+M4O?7\G
.f9{ font-size:9pt; }\.`L!|'g h,w4c)d
.bgc{ background-color:#aecaf9; color: #0033ff }w-@3w*Xe`'[7D
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;3O*U:D6jD8U+XAX F
border-bottom: solid 1px #4e7dc1;C9`'y']v5G?
border-left: solid 1px #aecaf9; aT/LQ3BN9Dl'A
border-right: solid 1px #5679bd;Nv#A4j w}!Vm
padding:1px;
margin:0px;}
</style>
<script language="javascript">
<!--TR\:N#G8_;@3RIh.c e
function rv()
{)KSN6q`ry3O
var val="";
for(i=0;i<combo_box.list2.length;i++){s.A[1`]3[tg
val+=","+combo_box.list2[i].value;
},~G1f!cav]g
if(val.charat(0)==","){2}.|*{!_`)k'CI(Em
val=val.substr(1,val.length);
}b3b8Y$HM \
opener.form1.frecname.value=val;
self.close();
}
//-->*T)T;aQ!bB4C
</script>G` @/y&t&QZ3l
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">i"s-NQ+]8~
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
<%w`W})wKy2b
cdatasource ds=new cdatasource(); //数据联结bean实例0q-Q B,`kj
java.sql.connection conn=ds.getconnection();(Jt,}tzaQ"d5S
java.sql.statement stmt=null;
java.sql.resultset rs=null; | CmF7NW
cdatacheck dc=new cdatacheck();_-|n(AP'kX
%>@1o;a!sA
<%'x p[G[x#b
string sqlu="select t1.fno, t1.fname, t2.fname as fdept from tuser t1 left outer join tdept t2 on t1.fdept = t2.fno order by t2.fname";
stmt=conn.createstatement();5~ W!byAa g
rs=stmt.executequery(sqlu);
%>7kF$wt&@XD
<script language='javascript'>U u.?K En
arr = new array();"WIe%|zDZ
<% int temp=0;
while(rs.next())
{'F1y/p ~9b{
%>
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");6s3a_wd
<%
temp = temp + 1;g&L WR5YO
}