yui构建treeview时为何报错"Dom is undefined"

mengda1027 发布于 2014/10/19 21:20
阅读 190
收藏 0
YUI

开源之夏第三届火热来袭,高校学生参与赢万元奖金!>>>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>YUI Tree Test</title>
		<link rel="stylesheet" type="text/css" href="build/fonts/fonts-min.css" />
		<link rel="stylesheet" type="text/css" href="build/treeview/assets/skins/sam/treeview.css" />
	</head>
	<body>
		<div id="demoTreeDiv" style="margin:10px; border:1px solid #EEE;"></div>
		<script type="text/javascript" src="build/yahoo/yahoo.js"></script>
		<script type="text/javascript" src="build/event/event.js"></script>
		<script type="text/javascript" src="build/treeview/treeview.js"></script>
		<script type="text/javascript">
			window.onload = init;
			function init(){
				var treeView = new YAHOO.widget.TreeView('demoTreeDiv');
				var node1 = new YAHOO.widget.TextNode("node",treeView.getRoot(),false);
				var node2 = new YAHOO.widget.TextNode("node1",node1,false);
				var node3 = new YAHOO.widget.TextNode("node2",node2,false);
				var node4 = new YAHOO.widget.TextNode("node3",node3,false);
				var node5 = new YAHOO.widget.TextNode("node4",node3,false);
				treeView.draw();
			}	
		</script>
	</body>
</html>



用YUI构建tree的一个DEMO为何报错:"Dom is undefined?"

YUI版本2.9.0

请各位帮忙给个提示,十分感谢!


以下是问题补充:

@mengda1027:var treeView = new YAHOO.widget.TreeView('demoTreeDiv'); 在这一句就报错提示,源码里的具体位置是: this._el = Dom.get(id); (2014/10/20 08:43)
加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部