couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [3/8] git commit: updated refs/heads/1.3.x to f31f608
Date Sun, 19 May 2013 11:31:20 GMT
Fix errors in, improve style of EventSource example code.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7acfc5bd
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7acfc5bd
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7acfc5bd

Branch: refs/heads/1.3.x
Commit: 7acfc5bdd147c1e27f0f5524b18984712df5f115
Parents: fb6d995
Author: Dirkjan Ochtman <djc@apache.org>
Authored: Sun May 19 13:04:17 2013 +0200
Committer: Dirkjan Ochtman <djc@apache.org>
Committed: Sun May 19 13:04:17 2013 +0200

----------------------------------------------------------------------
 share/doc/src/changes.rst |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7acfc5bd/share/doc/src/changes.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/changes.rst b/share/doc/src/changes.rst
index 70f4ab0..fbfb0c3 100644
--- a/share/doc/src/changes.rst
+++ b/share/doc/src/changes.rst
@@ -197,19 +197,21 @@ specification`_ for further details.
 
     // define the event handling function
     if (window.EventSource) {
-      var source = new EventSource(
-              "/somedatabase/_changes?feed=eventsource");
+
+      var source = new EventSource("/somedatabase/_changes?feed=eventsource");
       var results = [];
       var sourceListener = function(e) {
         var data = JSON.parse(e.data);
         results.push(data);
       };
 
-    // start listening for events
-    source.addEventListener('message', sourceListener , false);
-
-    // stop listening for events
-    source.removeEventListener('message', sourceListener , false);
+      // start listening for events
+      source.addEventListener('message', sourceListener, false);
+      
+      // stop listening for events
+      source.removeEventListener('message', sourceListener, false);
+      
+    }
 
 .. note::
 


Mime
View raw message