我想知道为什么 dojo 不响应元素的更改?我做了一个简单的例子来展示我的问题!
<html >
<head>
<script>dojoConfig = {parseOnLoad: true}</script>
<script src='../dojo/dojo.js'></script>
<script>
require([
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"
]);
require(["dojo/dom","dojo/on","dojo/domReady!"], function(dom, on){
on(dom.byId("tester"),"resize", function() { console.log('window on resize') });
});
</script>
</head>
<body>
<div data-dojo-type="dijit/layout/ContentPane" style="width: 50%;" >
<div data-dojo-type="dijit/layout/BorderContainer" id="tester">
</div>
</div>
</body>
</html>
使用时一切正常,on(window,"resize", function());
但我不知道为什么上面的示例不起作用。