summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/jsapi.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/api/jsapi.txt b/api/jsapi.txt
index f6122dde..ac8a530d 100644
--- a/api/jsapi.txt
+++ b/api/jsapi.txt
@@ -1156,10 +1156,25 @@ _returns_;; A new deferred that can be used to chain callbacks.
==== *Examples* ====
-Simple usage of a deferred:
+The builtin function system.spawn returns a deferred:
[source,javascript]
---------------------------------
+system.spawn("command").then(
+ function()
+ {
+ /* called when execution was successful */
+ },
+ function(errorcode)
+ {
+ /* called when execution wasn't successful */
+ }
+);
+---------------------------------
+
+Simple usage of a deferred:
+[source,javascript]
+---------------------------------
function loadUri(uri) {
var d = new Deferred();
tabs.current.loadUri(uri, function(wv) {