为了账号安全,请及时绑定邮箱和手机立即绑定

javascript树形不能显示,文件是从学生管理系统开发老师给的素材,具体问题如下

javascript树形不能显示,文件是从学生管理系统开发老师给的素材,具体问题如下

编程人生纪 2017-10-30 17:31:38
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE html><html><head> <title>导航树</title> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <style type="text/css">@import url('components/dtree/dtree.css');</style> <script type="text/javascript">var dtreeIconBasePath = "components/dtree";</script> <script type="text/javascript"  src="components/dtree/dtree.js"></script></head><body><script type="text/javascript"> var treeMenu = [ { level:1, name:"学生管理"}, { level:2, name:"学生列表", ico:"images/icon_default.gif",link:"role_list.html"}, { level:1, name:"教师管理"}, { level:2, name:"教师列表", ico:"images/icon_default.gif",link:"role_list.html"}, { level:1, name:"信息管理"}, { level:2, name:"新闻管理", ico:"images/icon_default.gif",link:"news_list.html"}, { level:2, name:"公告管理", ico:"images/icon_default.gif",link:"bulletin_list.html"}, { level:1, name:"系统邮件", ico:"images/icon_default.gif"}, { level:1, name:"网络文件", ico:"images/icon_default.gif",link:"complaint_list.html"}];</script><style>* {    background: none repeat scroll 0 0 transparent;    border: 0 none;    margin: 0;    padding: 0;    vertical-align: baseline; font-family:微软雅黑; overflow:hidden;}#menuControll{ width:100%; position:relative; word-wrap:break-word; border-bottom:1px solid #065FB9; margin:0; padding:0 10px; font-size:14px; height:40px; line-height:40px; vertical-align:middle;    background-image: -moz-linear-gradient(top,#EBEBEB, #BFBFBF);    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #EBEBEB),color-stop(1, #BFBFBF));}</style><div id="menuControll">菜单控制:【<a href="#" onclick="tree.openAll();this.blur();return false;" style="color:#333333;text-decoration:none">展开</a>】【<a href="#" onclick="tree.closeAll();this.blur();return false;" style="color:#333333;text-decoration:none">折叠</a>】</div><div class="dtree" style="margin:10px;"><script type="text/javascript"> //建立新树tree = new dTree('tree');tree.config.target = "MainFrame";tree.config.useCookies = false;var selNum = -1;var link = "";//根目录tree.add(0,-1,'管理中心', null, null, null, '', '');var count = 0;var pLevelIdArray = new Array();pLevelIdArray[1] = 0;var currLevel = 1;for (var i=0; i<treeMenu.length; i++) { var item = treeMenu[i]; var itemLevel = item.level; pLevelIdArray[itemLevel+1] = ++count; if (item.link!=null && item.link!="") { if (item.ico!=null) { tree.add(count, pLevelIdArray[itemLevel], item.name, item.link, null, null, item.ico, item.ico); } else { tree.add(count, pLevelIdArray[itemLevel], item.name, item.link); } } else { if (item.ico!=null) { tree.add(count, pLevelIdArray[itemLevel], item.name, null, null, null, item.ico, item.ico); } else { tree.add(count, pLevelIdArray[itemLevel], item.name); } } if (item.select) { selNum = count; link = item.link; }}document.write(tree);tree.openAll();if (selNum != -1) { tree.openTo(selNum,true); top.document.frames["MainFrame"].location.href=link;}</script></div></body></html>打开页面就是这样,按道理来说里面的树形会出来,结果都没有。听讲解学生管理系统的老师说,要用什么框架启动。对于javascript,基本没学。不懂。就是想知道怎么做。界面能够显示
查看完整描述

1 回答

已采纳
?
慕九州9845555

TA贡献3条经验 获得超0个赞

请导入素材中的js并且设置好路径,

查看完整回答
反对 回复 2017-11-02
  • 1 回答
  • 0 关注
  • 1422 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信