Opened 12 years ago

Closed 12 years ago

#2765 closed defect (fixed)

xd: dojo.addOnLoad issue if dojo.require() things as part of an addOnLoad listener

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 0.9
Component: Loader Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

There is an issue in xd loading if you do a dojo.require() as part of an addOnLoad listener, and after

dojo.addOnLoad(function(){
  dojo.require("dojo.crypto.MD5");
  dojo.addOnLoad(function(){
    //do something with dojo.crypto in here.
  });
});

The inner addOnLoad adds that listener to the same queue as the outer addonload queue, so it ends up executing before the dojo.require statements finish. Need to move the current queue off so that new dojo.addOnLoads happen after outstanding modules have loaded.

This might get a bit messy. If it looks like it will be too invasive, punt to 0.9.

Change History (2)

comment:1 Changed 12 years ago by James Burke

Milestone: 0.4.40.9

Moving to 0.9.

comment:2 Changed 12 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [9970]) Fixes #2765: calling dojo.addOnLoad inside a dojo.addOnLoad after doing an xdomain dojo.require() should work now.

Note: See TracTickets for help on using tickets.