/
1_NamedDeferredsNoGlobals.html
60 lines (51 loc) · 1.29 KB
/
1_NamedDeferredsNoGlobals.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../consoleTest.js" type="text/javascript"></script>
<script src="../../../jquery.defer.js" type="text/javascript"></script>
<script src="../resources/myScriptDefs.js" type="text/javascript"></script>
<script type="text/javascript">
(function() {
$.defer( "../resources/folder1/c.js", {
myVal: "sendC",
readyName: "c"
})
.done( log );
$.defer.a({
myVal: "sendA",
delayDomReady: true
})
.done( log );
}());
</script>
</head>
<body>
<b>Results:</b> <span id="results"></span>
<script type="text/javascript">
(function() {
$.ready.a
.done( function( result ){
log( "a: " + result );
});
$.ready.c
.done( function( result ){
log( "c: " + result );
});
$.ready.e
.done( function( result ){
log( "e: " + result );
});
$.when(
$.ready.a,
$.ready.c,
$.ready.e,
$.ready
)
.done( function( result0, result1, result2 ){
log( "a, c, e and domReady: " + result0 + ", " + result1 + ", " + result2 );
});
}());
</script>
</body>
</html>