日期:2014-05-18  浏览次数:20731 次

高手帮忙啊~!~jsp页面调用javascript问题.
问题描述:根据管理员的权限在左边导航栏显示相应的功能模块,单击右键的查看源代码,可以看到一级目录和二级目录都可以得到.但是在页面一级目录却不能展开.(二级树状菜单)

代码如下:
<%@page   contentType= "text/html;charset=gb2312 "
import= "com.cmesn.struts.action.left_list,java.sql.* "%>
<%@   page   import= "com.cmesn.struts.Bean.MySqlAdminDAO "%>
<%@   page   import= "com.cmesn.struts.form.LoginForm; "%>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<style   type= "text/css ">
<!--
.STYLE1   {font-size:   2}
--> a{TEXT-DECORATION:none}
a:link{color:#800080}
a:visited{color:#800080}
a:hover{color:#800080}
                </style>
</head>
<body>
<script   language= "javascript ">
function   ShowTR(objImg,objTr){
if(objTr.style.display== " "){
objTr.style.display= "none ";
objImg.src= "../img/jia.gif ";
objImg.alt= "展开 ";
}else{
objTr.style.display= "block ";
objImg.src= "../img/jian.gif ";
objImg.alt= "折叠 ";
}
}
</script>

<table   width= "100% "   height= "40 "   border= "0 "   cellpadding= "0 "
cellspacing= "0 ">

<%left_list   conn   =   null;
ResultSet   rs_superType   =   null;

HttpSession   sion   =   request.getSession();
String   name   =   (String)   sion.getAttribute( "admin_name ");
String   passwd   =   (String)   sion.getAttribute( "admin_passwd ");
System.out.println( "************************** "   +   name);
System.out.println( "********************************* "   +   passwd);
MySqlAdminDAO   dd   =   new   MySqlAdminDAO();
String   powers   =   dd.getPowers(name,   passwd);
String[]   s   =   powers.split( ", ");
for   (int   i   =   0;   i   <   s.length;   i++)   {
System.out.println( "---------////////// "   +   s[i]);
conn   =   new   left_list();
String   sqls   =   "select   *   from   cmesn_sort   where   bigsort_id=0   and   sort_id   =   "
+   s[i]   +   "   group   by   Sort_id,Sort   order   by   Sort   desc   ";
rs_superType   =   conn.check(sqls);
System.out.println( "####################### "   +   sqls);
//   }  

int   ID_superType   =   0;//获取ID
String   superType   =   " ";//获取分模块
int   m   =   1;
while   (rs_superType.next())   {
ID_superType   =   rs_superType.getInt(1);//获取ID编号
superType   =   rs_superType.getString(2);//获取模块
String   sql   =   "select   *   from   cmesn_sort   where   bigsort_id= "
+   ID_superType;//获取相同ID,并把相同ID放在一个模块里面
ResultSet   rs_subType &