Opened 14 years ago
Closed 14 years ago
#3973 closed defect (fixed)
dojo.require doesn't support base tag
Reported by: | guest | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Loader | Version: | 0.9 |
Keywords: | Cc: | alex | |
Blocked By: | Blocking: |
Description
Using a base tag in html will ensure you are always able to use a site relative path for all dependencies. dojo.require fails if a base tag is used.
maintenance
-States.htm
scripts
dojo
-dojo.js
With this folder structure, the first require when loading States.htm (included below) is for the firebug.js in IE or lang.js for FireFox?. dojo.require tries to get the code from .../maintenance/scripts/dojo/_firebug/firebug.js or .../maintenance/scripts/dojo/_base/lang.js.
Looks like either the _getText in hostenv_browser.js or the constructor for dojo._Url in loader.js needs to change to check for a base tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <base href='http://mikes:80/atg-framework/'></base> <title>Test Page</title> <script type="text/javascript" src="scripts/dojo/dojo.js" djconfig="parseOnLoad: true, isDebug: true"></script> </head> <body> </body> </html>
Attachments (1)
Change History (5)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | hostenv_browser.patch added |
---|
comment:2 Changed 14 years ago by
Cc: | alex added |
---|---|
Milestone: | → 0.9 |
Owner: | changed from alex to James Burke |
I would like to remove that dojo._Url call too, but it was done to fix #2757. There is something really weird going on with Mozilla, and I haven't been able to isolate why it is happening. I've tried a couple times already, but no luck so far. I'll see if I can do more investigation before 0.9 wraps up.
comment:3 Changed 14 years ago by
Just as a side note, confirming the code in this ticket description is using the correct usage of the base tag (confirmed against comments in #1991).
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Seems like a simple fix for this is to remove the window.location from the dojo._Url construction. Patch attached. I have tried this on IE with and without a base tag and it seems to work fine. No other browsers tested.