Opened 14 years ago

Closed 14 years ago

#544 closed defect (invalid)

dojo.event.connect works differently in IE6.0 and Firefox1.5.0.1

Reported by: anonymous Owned by: anonymous
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

using dojo.event.connect to attach a handler to the body element works in IE6.0.2900.2180 - but not in Firefox1.5.0.1

This code produces 2 toolbars in IE - only one in Firefox (and if dojoType="Editor" is removed from the 'dojoEditor' DIV tag, one is produced IE, and none in Firefox:

        <script src="/scripts/dojo/dojo.js" type="text/javascript"></script>
        <script type="text/javascript">
            dojo.require("dojo.widget.Editor");
            
            function loadPage() {
                var editor = dojo.widget.fromScript("Editor", {}, dojo.byId("dojoEditor"));
            }
            
        </script>
    </head>
    <body id="bodyNode">
        <div id="dojoEditor" dojoType="Editor" >
            some content
        </div>
    
        <script type="text/javascript">
            var bodyNode = document.getElementById("bodyNode");
            dojo.event.connect(bodyNode, "onload", "loadPage");
        </script>
    </body>

Change History (1)

comment:1 Changed 14 years ago by sjmiles

Resolution: invalid
Status: newclosed

In general, clobbering body.onload will break Dojo 0.2+.

Please use dojo.addOnLoad to register a load-time handler. E.g.

dojo.addOnLoad(loadPage);

Note: See TracTickets for help on using tickets.