ztree树节点打开异常
@zTree 你好,想跟你请教个问题:
我做了一个demo,静态页面能打开页面上的三个树,但在tomcat下运行服务登陆之后反而打不开,请赐教。
静态页面standardData.htm的路径是WEB-INFviewssystemuserstandardData.htm,
用到的css和js 路径在WEB-INFclassesaaajsztree
standardData.htm页面内容如下:
<!DOCTYPE html> <HTML> <HEAD> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../classes/aaa/js/ztree/css/zTreeStyle.css" type="text/css"> <script type="text/javascript" src="../../../classes/aaa/js/ztree/js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="../../../classes/aaa/js/ztree/js/jquery.ztree.core-3.3.js"></script> <SCRIPT type="text/javascript"> <!-- var setting = { }; var zNodes =[ { name:"系统角色", open:true, children: [ { id:"1",name:"超级管理员"}, { id:"2",name:"角色2"}, { id:"3",name:"角色3"}, { id:"4",name:"角色4"}, { id:"5",name:"角色5"} ]} ]; var zNodes2 =[ { name:"功能1", open:true, children: [ { id:"1",name:"11"} ] }, { name:"功能2", open:true, children: [ { id:"1",name:"22"}, { id:"1",name:"23"}, { id:"1",name:"24",open:true,children:[ { id:"1",name:"241"}, { id:"1",name:"242"} ]} ] } ]; var zNodes3 =[ { name:"办公室", open:true, children: [ {id:"admin",name:"admin"}, {id:"admin",name:"张三"}, {id:"admin",name:"李四"}, {id:"admin",name:"王五"} ] } ]; $(document).ready(function(){ $.fn.zTree.init($("#treeRole"), setting, zNodes); }); $(document).ready(function(){ $.fn.zTree.init($("#treeRole2"), setting, zNodes2); }); $(document).ready(function(){ $.fn.zTree.init($("#treeRole3"), setting, zNodes3); }); //--> </SCRIPT> <style> <-- body { font-family: Verdana; font-size: 14px; margin: 0; } .container { margin: 0 auto; width: 900px; } .header { height: 25px; background: #6cf; margin-bottom: 1px; text-align: center; } .menu { height: 25px; background: #09c; margin-bottom: 1px; } .mainContent { height: 500px; margin-bottom: 1px; } .sidebar { float: left; width: 200px; height: 500px; background: #ADD8E6; text-align: center; } .sidebar2 { float: right; width: 300px; height: 500px; background: #B0E0E6; text-align: center; } .content { margin: 0 202px; height: 500px; background: #cff; text-align: center; } .add { background: #ADD8E6; margin-left: 5px; } .update { background: #ADD8E6; } .delete { background: #ADD8E6; } .save { background: #ADD8E6; } --> </style> </HEAD> <body> <div class="container"> <div class="header"> 用户角色权限管理 </div> <div class="menu"> <input type="button" id="add" class="add" value="增加" > <input type="button" id="update" class="update" value="修改"> <input type="button" id="delete" class="delete" value="删除"> <input type="button" id="save" class="save" value="保存"> </div> <div class="mainContent"> <div class="sidebar"> 角色 <ul id="treeRole" class="ztree"></ul> </div> <div class="sidebar2"> 角色用户 <ul id="treeRole3" class="ztree"></ul> </div> <div class="content"> 角色权限 <ul id="treeRole2" class="ztree"></ul> </div> </div> </div> </body> </HTML>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你好,Tomcat 的
WEB-INF 目录可不是普通的发布目录呀,http 访问是不能直接从 这个目录下面获取文件的!!