diff options
author | portix <portix@gmx.net> | 2012-12-07 18:36:07 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-12-07 18:36:07 +0100 |
commit | 258e4e4b60c69c2d47369d15003cac863444b1d8 (patch) | |
tree | 2eab97c8aad34af7cbb8ea32cd467adf75c7c82a /api/dwb-js.7 | |
parent | 1a1b8f71d1a055ede111036a40eb57e97d2a154b (diff) | |
download | dwb-258e4e4b60c69c2d47369d15003cac863444b1d8.zip |
Updated js-api
Diffstat (limited to 'api/dwb-js.7')
-rw-r--r-- | api/dwb-js.7 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7 index 75ae3ac0..db781718 100644 --- a/api/dwb-js.7 +++ b/api/dwb-js.7 @@ -1337,17 +1337,19 @@ function foo(message) }); return d; } +function callback1(response) +{ + io\&.print(response); // Prints "foo" after 2 seconds -foo("foo")\&.done( - function(response) { - io\&.print(response); // Prints "foo" after 2 seconds + // Return a new Deferred, will replace the old one\&. + return foo("bar"); +} +function callback2(response) +{ + io\&.print(response); // Prints "bar" after 4 seconds +} - // Return a new Deferred, will replace the old one\&. - return foo("bar"); - })\&.done( - function(response) { - io\&.print(response); // Prints "bar" after 4 seconds - }); +foo("foo")\&.done(callback1)\&.done(callback2); .fi .if n \{\ .RE |