Ticket #2280 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: pat@… Owned by: jburke
Priority: normal Milestone:
Component: BuildSystem Version: 0.4.1
Severity: normal Keywords:
Cc:

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

2280-testcase.zip (0.9 kB) - added by pat@… 2 years ago.
two test cases that show the IE bug

Change History

Changed 2 years ago by pat@…

two test cases that show the IE bug

Changed 2 years ago by jburke

  • owner changed from anonymous to jburke
  • status changed from new to assigned
  • component changed from General to BuildSystem
  • milestone set to 0.5

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.

Changed 2 years ago by jburke

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 0.9 to 0.4.2

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

Changed 2 years ago by anonymous

  • milestone deleted

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.