dojo第一个你好dojo教程没有工作



在主站点提供的第一个hello dojo教程https://dojotoolkit.org/documentation/tutorials/1.10/hello_dojo/index.html对我不起作用。

我复制粘贴了代码,但"Hello"保持原样。没有添加em标记。任何帮助!

我下载了dojo.js并将文件放在hellodojo.html所在的位置。然后我更改了hellodojohtml的代码如下:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Tutorial: Hello Dojo!</title>
</head>
<body>
    <h1 id="greeting">Hello</h1>
    <!-- load Dojo -->
    <script src="./dojo.js" data-dojo-config="async: true"></script>
    <script>
        require([
            'dojo/dom',
            'dojo/dom-construct'
            ], function(dom, domConstruct) {
                var greetingNode = dom.byId('greeting');
                domConstruct.place('<em> Dojo!!~!!</em>', greetingNode);
            });
    </script>
</body>
</html>

在这里你会看到我更改了声明

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"
        data-dojo-config="async: true"></script>

<script src="./dojo.js" data-dojo-config="async: true"></script>

然后它按预期工作,因为dojo.js现在可用了。我也可以在源代码的chrome扩展中看到"dojo.js"。

最新更新