Opened 14 years ago
Closed 14 years ago
#3598 closed defect (duplicate)
'Normal' loading of external js with dojo.require fails in IE
Reported by: | guest | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Core | Version: | 0.4.2 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
In a custom widget, if I attempt to load some third-party js file to call some functions, I get "Object Expected" in IE.
I'm calling dojo.require("path.to.file", false, true) to load the js file, which I read in the dojo archives that using this syntax,
you can do without the "dojo.provide" call in your JS files by altering your dojo.require call.
e.g. dojo.require("my.path.to.file", false, true);
The last argument tells dojo not to validate that the object my.path.to.file exists, therefore you can put whatever you like in that file.
If i manually include the js script using a script tag, everything works fine in IE and firefox, so it's not a syntax error.
Simple test: create a custom widget, try to require (using the syntax above) an external js file which contains a simple function:
function test() { alert("test called"); }
and try to invoke that function from your custom widget.
Change History (2)
comment:1 Changed 14 years ago by
Owner: | changed from anonymous to James Burke |
---|
comment:2 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
The function test() will fail even with normal dojo.require/provide loading because of bug #744. If you do
That should work. The problem is the scope used by IE's eval. As outlined in #744, there is no good fix for the problem, except the workaround stated above. Closing this bug out as a dupe of #744.