couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [7/8] git commit: updated refs/heads/master to 947d116
Date Sun, 19 May 2013 11:31:24 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/55395eb3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/55395eb3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/55395eb3

Branch: refs/heads/master
Commit: 55395eb3c79ce1110ad23ca566b1d811931d7449
Parents: 481912a
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:30:45 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/55395eb3/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