Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#2280 closed defect (fixed)

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

Reported by: pat@… Owned by: James Burke
Priority: high Milestone:
Component: BuildSystem Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

When using the "sunday drive" easy method of including dojo (as described here: http://alex.dojotoolkit.org/?p=591) I get an intermittent error in IE6:

'dojo' is undefined

The cross-domain url I am using is as follows: http://download.dojotoolkit.org/release-0.4.1/dojo-0.4.1-xdomain-ajax/dojo.js

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="http://download.dojotoolkit.org/release-0.4.1/dojo-0.4.1-xdomain-ajax/dojo.js">
</script>
<script type="text/javascript">
dojo.registerModulePath("dojo", "http://download.dojotoolkit.org/release-0.4.1/dojo-0.4.1-xdomain-ajax/src");
</script>

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: http://www.xk72.com/charles/)

Attachments (1)

2280-testcase.zip (921 bytes) - added by pat@… 13 years ago.
two test cases that show the IE bug

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by pat@…

Attachment: 2280-testcase.zip added

two test cases that show the IE bug

comment:1 Changed 13 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:

http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book48

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 12 years ago by James Burke

Milestone: 0.90.4.2
Resolution: fixed
Status: assignedclosed

This is fixed in 0.4.2. See http://build.dojotoolkit.org/0.4.2/ for info.

comment:3 Changed 12 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.