代码如下:<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort() + path + "/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>Tree Demo</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.jstree.js"></script>
<script type="text/javascript">
$(function (){
$("#demo1").jstree({
"xml_data" : {
"data" : ""+
"<root>" +
"<item id='node_1'>" +
"<content><name>Root node 1</name></content>" +
"</item>" +
"<item>" +
"<content><name>Root node 2</name></content>" +
"</item>" +
"<item parent_id='node_1'>" +
"<content><name>Child node</name></content>" +
"</item>" +
"</root>"
},
"plugins" : ["themes","xml_data"]
});
});
</script>
</head> <body>
<div>
<h3>MyTree</h3>
</div>
<div id = "#demo1">
</div>
</body>
</html>
JQuery版本1.4.2
jsTree版本为1.0琢磨了好些时间了,高手们看看!
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort() + path + "/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>Tree Demo</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.jstree.js"></script>
<script type="text/javascript">
$(function (){
$("#demo1").jstree({
"xml_data" : {
"data" : ""+
"<root>" +
"<item id='node_1'>" +
"<content><name>Root node 1</name></content>" +
"</item>" +
"<item>" +
"<content><name>Root node 2</name></content>" +
"</item>" +
"<item parent_id='node_1'>" +
"<content><name>Child node</name></content>" +
"</item>" +
"</root>"
},
"plugins" : ["themes","xml_data"]
});
});
</script>
</head> <body>
<div>
<h3>MyTree</h3>
</div>
<div id = "#demo1">
</div>
</body>
</html>
JQuery版本1.4.2
jsTree版本为1.0琢磨了好些时间了,高手们看看!
解决方案 »
- 用SSH框架开发的WEB项目连接数据库不成功没有显示错误信息
- 请教struts配置文件中使用通配符的问题
- 这样就可以防御JSP的sql注入吗?
- 关于javabean的应用
- ajax每隔一分中就查询一次数据库
- 请教高手,如何在JSP或者servlet里接收到动态表单提交的数据.用vector接收
- Hibernate 高手进来帮个忙
- 急!!!!急!!!!
- 快来看看这段程序。是哪里错了?javabean?jsp?只有这些分了,请帮个忙,谢谢!!
- 利用myeclipse做hibernate反向生成po小问题
- 急急!!求教高手POI读取Excel问题
- <textarea></textarea>里的换行标记到底是什么?
自己找个例子看看!
这句不对,去掉#符号就行了