dojo first hello dojo 教程没有用
dojo first hello dojo tutorial did not work
主站点上提供的第一个 hello dojo 教程 https://dojotoolkit.org/documentation/tutorials/1.10/hello_dojo/index.html 对我不起作用。
我复制粘贴了代码,但 'Hello' 保持原样。不会添加 em 标签。任何帮助!
我下载了 dojo.js 并将文件放在 hellodojo.html 所在的相同位置。然后我将 hellodojo.html 的代码更改如下:
<!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'。
主站点上提供的第一个 hello dojo 教程 https://dojotoolkit.org/documentation/tutorials/1.10/hello_dojo/index.html 对我不起作用。
我复制粘贴了代码,但 'Hello' 保持原样。不会添加 em 标签。任何帮助!
我下载了 dojo.js 并将文件放在 hellodojo.html 所在的相同位置。然后我将 hellodojo.html 的代码更改如下:
<!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'。