Newbie Dojo-Google CDN问题 [英] Newbie Dojo - Google CDN Question

查看:75
本文介绍了Newbie Dojo-Google CDN问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试jsp,

<head>
    <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript">
</script>

<script type="text/javascript"> 
dojo.require("dojo.widget.Tree"); 
dojo.require("dojo.widget.TreeSelector"); 
dojo.require("dojo.widget.TreeNode"); 
dojo.require("dojo.widget.TreeContextMenu"); 
</script> 
</head>

<body>
<div dojoType="TreeSelector" widgetId="treeSelector"></div> 
<div dojoType="Tree" widgetId="treeWidget" selector="treeSelector"toggler="wipe"> 
<div dojoType="TreeNode" widgetId="1" title="First node" isFolder="false"></div> 
<div dojoType="TreeNode" widgetId="2" title="Second node"> 
    <div dojoType="TreeNode" widgetId="2.1" title="Second node First Child"></div> 
    <div dojoType="TreeNode" widgetId="2.2" title="Second node Second Child"></div> 
</div> 
<div dojoType="TreeNode" widgetId="3" title="Third node" isFolder="false"></div> 
</div>

此功能不适用于任何浏览器。
我以为这很容易,看来dojo库没有被下载/找到?
我还需要做其他事情吗?

This will not work in any browser. I thought this would be easy, it seems the dojo library is not being downloaded/found? Do I need to do anything else?

此外,我的IDE(JDeveloper)报告元素div上未定义属性 dojoType。

Also, my IDE, JDeveloper, reports that the attribute "dojoType" is not defined on element div.

推荐答案

我不得不说,这个示例看起来像是从非常 >旧版本的dojo,但您正在尝试针对Dojo 1.5运行它。那很可能行不通。 dojo.widget 自... 0.4到0.9以来就不存在了。

I have to say, this example looks like it is taken from a very old version of dojo, but you're trying to run it against Dojo 1.5. That most likely won't work. dojo.widget hasn't existed since...0.4, 0.9 maybe.

您可能正对您对上一个答案进行注释,因为在原始示例中不需要 parseOnLoad:true ,但我还要向您保证,该示例在附近的任何地方都没有运行任何版本的Dojo

You may be right in your comment to the previous answer in that no parseOnLoad: true was necessary in the original example, but I'd also assure you that that example was not running any version of Dojo anywhere near what you're running it with.

根据您在此处看到的内容,您可能希望从以下位置开始: http://www.dojotoolkit.org/reference-guide/dijit/Tree.html

Based on what you're looking at there, you may want to start somewhere like here: http://www.dojotoolkit.org/reference-guide/dijit/Tree.html

这篇关于Newbie Dojo-Google CDN问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆