I cannot find the way to access progammatically to a dijit.Dialog. The following code:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dialog</title>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js"></script>
<script type="text/javascript">
开发者_运维百科 dojo.require("dijit.Dialog");
dojo.addOnLoad(function() {
var myDialog = dojo.byId("myDialog");
myDialog.attr("content", "My New Content")
})
</script>
</head>
<body class="claro">
<div id="myDialog" dojoType="dijit.Dialog" title="My Dialog">
</div>
</body>
</html>
causes the following error: "myDialog.attr is not a function". The same happens if I use "set" method instead of "attr".
Solved! instead of using dojo.byId I should have used dijit.byId !
精彩评论