JStree视图问题
我正在尝试在网页中获取树视图。我正在使用 jstree 插件来显示树视图。我实际上是 jQuery 的新手。以下是我写的代码。
<%--
Document : folderView
Created on : Nov 2, 2010, 3:31:55 PM
Author : Vamshidhar
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>hi</title>
<script type="text/javascript" src="jquery.jstree.js"></script>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<div id="demo1" class="demo"></div>
<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>
</body>
</html>
谁能帮我找出问题所在吗?
提前致谢
I am trying get tree view in the web page. I am using jstree plugin for the tree view. I am actually new to jQuery. The following is the code i have written.
<%--
Document : folderView
Created on : Nov 2, 2010, 3:31:55 PM
Author : Vamshidhar
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>hi</title>
<script type="text/javascript" src="jquery.jstree.js"></script>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<div id="demo1" class="demo"></div>
<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>
</body>
</html>
Can anyone help me figure out what is wrong?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试更改加载 js 文件的顺序,这对我有用。
希望这有帮助,快乐
Try changing the order of loading the js files it got things working for me.
Hope this helps, be happy