我正在dojo中尝试bordercontainer的基本示例,下面是它的html代码,但它没有显示所需的输出。谁能告诉我我在这里做错了什么。我仅从 dojo 教程中获取此示例代码,并且在 firebug 中也没有收到任何错误。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ICN Layout</title>
</head>
<body>
<!-- load Dojo -->
<script>dojoConfig = {parseOnLoad: true}</script>
<script src="dojo/dojo.js">
</script>
<script>
require([
"dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dojo/domReady!"
], function(BorderContainer, ContentPane){
// create a BorderContainer as the top widget in the hierarchy
var bc = new BorderContainer({
style: "height: 300px; width: 500px;"
});
// create a ContentPane as the left pane in the BorderContainer
var cp1 = new ContentPane({
region: "left",
style: "width: 100px",
content: "hello world"
});
bc.addChild(cp1);
// create a ContentPane as the center pane in the BorderContainer
var cp2 = new ContentPane({
region: "center",
content: "how are you?"
});
bc.addChild(cp2);
// put the top level widget into the document, and then call startup()
bc.placeAt(document.body);
bc.startup();
});
</script>
</body>
</html>