我是 Javascript 和 YUI 的新手。当我尝试使用 YUI 3(wrt http://allenrabinovich.github.com/gallery-yui-treeview/docs/)实现树视图时,我收到以下错误: yui:未加载:树视图 Y.TreeView 不是构造函数 {标签:“第二章”}
请帮我调试错误。这是代码:
<!DOCTYPE html>
<html>
<head>
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js">
</script>
</head>
<body>
<div id="toc" class="yui3-skin-sam">check
</div>
<script>
YUI().use('treeview', function (Y) {
var tree = new Y.TreeView({
label: 'My Novel',
children: [
{ label: 'Chapter One' },
{ label: 'Chapter Two' }
]
});
tree.render('#toc');
});
</script>
</body>
</html>