dtree的问题。在使用jquery+dtree+ajax生成动态树的时候报这么个错误 ReferenceError: tree is not defin
一共涉及一个JSP:一个sevlet,浏览器为firefox:其中dtree.js和jquery.js已经引入,jsp代码:<scripttype="text/javas...
一共涉及一个JSP:一个sevlet,浏览器为firefox:
其中dtree.js和jquery.js已经引入,
jsp代码:
<script type="text/javascript" src="dtree.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
var tree=new dTree("tree");
$.ajax({
url:"GetAll",
type:"post",
dataType:"xml",
error:function(){
alert("not lived");
},
async:false,
success:function(xml){
$(xml).find("node").each(function(){
var id=$(this).attr("nodeId");
var pid=$(this).attr("parentId");
var idvalue=$(this).text();
tree.add(id,pid,idvalue,"","","secFrame","","","");
});
}
});
document.write(tree);
});
</script>
数据库中的内容:
jsp页面上显示的内容:
错误提示: 展开
其中dtree.js和jquery.js已经引入,
jsp代码:
<script type="text/javascript" src="dtree.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
var tree=new dTree("tree");
$.ajax({
url:"GetAll",
type:"post",
dataType:"xml",
error:function(){
alert("not lived");
},
async:false,
success:function(xml){
$(xml).find("node").each(function(){
var id=$(this).attr("nodeId");
var pid=$(this).attr("parentId");
var idvalue=$(this).text();
tree.add(id,pid,idvalue,"","","secFrame","","","");
});
}
});
document.write(tree);
});
</script>
数据库中的内容:
jsp页面上显示的内容:
错误提示: 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询