Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2280 closed defect (fixed)

Including cross-domain dojo build causes an error in IE (dojo is undefined)

Reported by: [email protected] Owned by: James Burke
Priority: high Milestone:
Component: BuildSystem Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


When using the "sunday drive" easy method of including dojo (as described here: I get an intermittent error in IE6:

'dojo' is undefined

The cross-domain url I am using is as follows:

This appears to be caused by a bug in IE. The cross-domain url writes two script elements to the page (using document.write). The first script element loads dojo.js, and the second script element calls dojo.registerModulePath.

The error occurs because IE6 evaluates the second script element before the first script element has finished.

Note that this behavior occurs only when using document.write to place the two script elements onto the page. If you construct a test page with the two script elements directly on the page then the bug does not occur.

So if you create a file with the following text, the bug will not occur, but if you use document.write to place the following text on the page, the bug occurs:

<script type="text/javascript" src="">
<script type="text/javascript">
dojo.registerModulePath("dojo", "");

Note that this error occurs only in IE (I am using IE6 on Windows XP but have not tested other versions). Also the bug intermittently appears - if necessary clear your cache or throttle your bandwidth to make this occur. (I recommend Charles web debugging proxy for throttling bandwidth:

Attachments (1) (921 bytes) - added by [email protected] 14 years ago.
two test cases that show the IE bug

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by [email protected]

Attachment: added

two test cases that show the IE bug

comment:1 Changed 14 years ago by James Burke

Component: GeneralBuildSystem
Milestone: 0.5
Owner: changed from anonymous to James Burke
Status: newassigned

I'm working on an improved "sunday drive" method for cross-domain loading for 0.5 In the meantime, you can follow the directions on this page to get it the cross-domain build working for you now:

Note that this still requires you to have a local dojo installation on your domain. 0.5 should also remove the local dojo install requirement.

comment:2 Changed 14 years ago by James Burke

Resolution: fixed
Status: assignedclosed

This is fixed in 0.4.2. See for info.

comment:3 Changed 14 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.