| 2150 |
mathias |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<script djConfig="isDebug: true" src="../../../../dojo.js"></script>
|
|
|
4 |
<script>
|
|
|
5 |
dojo.registerModulePath("foo", "tests/_base/_loader/744/foo");
|
|
|
6 |
dojo.require("foo.bar");
|
|
|
7 |
|
|
|
8 |
dojo.addOnLoad(function(){
|
|
|
9 |
console.debug(barMessage);
|
|
|
10 |
console.debug(getBar2Message());
|
|
|
11 |
console.debug(getBarMessage());
|
|
|
12 |
});
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
dojo.addOnLoad(function(){
|
|
|
16 |
//This fails if window.execScripts is used for MSIE, since that function
|
|
|
17 |
//does not return a value.
|
|
|
18 |
var temp = "({name: 'light'})";
|
|
|
19 |
var evalTemp = dojo.eval(temp);
|
|
|
20 |
console.debug("Object's name is: ", evalTemp.name);
|
|
|
21 |
});
|
|
|
22 |
|
|
|
23 |
</script>
|
|
|
24 |
</head>
|
|
|
25 |
<body>
|
|
|
26 |
<p>
|
|
|
27 |
Defining global variables/functions in a module that is loaded via dojo.require()
|
|
|
28 |
(meaning that XHR is used to load the text of the file and then eval the text) does
|
|
|
29 |
not seem to define the global variables/functions on window.
|
|
|
30 |
</p>
|
|
|
31 |
|
|
|
32 |
<p>
|
|
|
33 |
The test succeeds if you see "It Worked" 3 times in the debug console, then a "Object's name is: light" message.
|
|
|
34 |
</p>
|
|
|
35 |
|
|
|
36 |
</body>
|
|
|
37 |
</html>
|