I am trying basic example of bordercontainer in dojo and below is the html code for it, but it does not show the required output. Can anyone tell me what I am doing wrong here. This sample code I have taken from dojo tutorial only and also I am not getting any error as well in 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>
I don't know if your dojo/dojo.js file is loading correctly, but I don't see the needed dojo css files in your code. Make sure to include those (based on the theme you are using). for example:
Here are two working examples that show your code working:
Pen: http://codepen.io/kyledodge/pen/RPVjgY
Fiddle: http://jsfiddle.net/6v0x0jue/2/