Opened 16 years ago

Closed 16 years ago

#696 closed defect (fixed)

Dynamical package loading in Opera depends on "Content-Type" for *.js files

Reported by: amonduul <[email protected]…> Owned by: anonymous
Priority: low Milestone:
Component: General Version: 0.2
Keywords: opera Cc:
Blocked By: Blocking:


When downloading packages via XmlHttpRequest?, if server sets "Content-Type: text/javascript", Opera misinterprets recieved content (as utf-16?) and fails to load package. (Some more info on this Opera behaviour here

Not sure there is a workaround to put in dojo.hostenv.getText. (Except, maybe, decoding utf16 to byte sequence and then to utf8, which seems to be tedious work, and not worth it).

Workaround in case you have access to server configuration: Change content type for *.js files from "text/javascript" to "application/x-javascript".

Possible workaround in case you don't have access to server configuration: Change extenstion for all loadable scripts to some other extension (e.g. *.dj or *.txt), and change the extenstion used for package loading in dojo.hostenv.loadModule.

Change History (2)

comment:1 Changed 16 years ago by [email protected]

Could you please try Opera build 8432 at

I'm not sure if this is what you're describing, but I had noticed that XMLHttpRequest did not use UTF-8 by default, as it should according to the W3C draft and to mimic Moz/IE. The Opera folks graciously fixed the bug within days of me pointing this out... Does it solve your problem?

Assuming your file is encoded in utf-8 and your server does not specify any special encodings, everything ought to work. I have not tested Opera in the case where encodings are specified and are something other than utf-8.

Regards, Adam

comment:2 Changed 16 years ago by dylan

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.