samples/2021/12/dojo_demo2/index.html

47 lines
1.0 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Dojo App</title>
<meta charset="utf-8" />
<!--dojoConfig-->
<script>
var dojoConfig = {
parseOnLoad: true,
async: true,
cacheBust: true, // Get "fresh" resources,
baseUrl: "/app",
packages: [
{name: "dojo", location: "/node_modules/dojo"},
{name: "dojox", location: "/node_modules/dojox"},
{name: "dijit", location: "/node_modules/dijit"}
]
};
</script>
<!--load dojo toolkit-->
<script src="/node_modules/dojo/dojo.js"></script>
<script>
require([
"dojo/dom",
"dojo/parser",
"app/widgets/MainWidget.js",
"dojo/domReady!"
], function (dom, parser, MainWidget) {
parser.parse(); // parseOnLoad: true doesn't run this. Why???
var greeting = dom.byId('root');
var widget = new MainWidget();
widget.placeAt(greeting);
widget.startup();
});
</script>
</head>
<body>
<div id="root"></div>
</body>
</html>