开发者

Cannot access programmatically to dijit.Dialog

开发者 https://www.devze.com 2023-03-25 00:02 出处:网络
I cannot find the way to access progammatically to a dijit.Dialog. The following code: <!DOCTYPE HTML>

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 !

0

精彩评论

暂无评论...
验证码 换一张
取 消