// Initialize an OpenTok Session object
var session = OT.initSession(apiKey, sessionId);

// Initialize a Publisher, and place it into the element with id="publisher"
var publisher = OT.initPublisher('publisher');

// Attach an event handler for when the session dispatches the 'streamCreated' event.
session.on('streamCreated', function(event) {
    // This function runs when another client publishes a stream (eg. session.publish())

    // Subscribe to the stream that caused this event, put it inside the DOM element with id='subscribers'
    session.subscribe(event.stream, 'subscribers', {
        insertMode: 'append'
    }, function(error) {
        if (error) {
            console.error('Failed to subscribe', error);
        }
    });
});

// Connect to the Session using the 'apiKey' of the application and a 'token' for permission
session.connect(token, function(error) {
    // This function runs when session.connect() asynchronously completes

    // Handle connection errors
    if (error) {
        console.error('Failed to connect', error);
    } else {
        // Publish the publisher we initialzed earlier (this will trigger 'streamCreated' on other
        // clients)
        session.publish(publisher, function(error) {
            if (error) {
                console.error('Failed to publish', error);
            }
        });
    }
});

@@ -336,26 +336,24 @@
 on(event) %7B%0A
-  
   // This fu
@@ -428,18 +428,16 @@
 ish())%0A%0A
-  
   // Sub
@@ -535,18 +535,16 @@
 bers'%0A  
- 
- 
 session.
@@ -584,20 +584,16 @@
 ers', %7B%0A
-    
     inse
@@ -609,18 +609,16 @@
 append'%0A
-  
   %7D, fun
@@ -628,28 +628,24 @@
 on(error) %7B%0A
-    
     if (erro
@@ -651,30 +651,24 @@
 or) %7B%0A      
-    
-  
 console.erro
@@ -704,24 +704,18 @@
 r);%0A    
-    %7D%0A  
+%7D%0A
   %7D);%0A%7D)
@@ -851,18 +851,16 @@
 rror) %7B%0A
-  
   // Thi
@@ -924,18 +924,16 @@
 pletes%0A%0A
-  
   // Han
@@ -954,18 +954,16 @@
  errors%0A
-  
   if (er
@@ -969,28 +969,24 @@
 rror) %7B%0A    
- 
-   
 console.erro
@@ -1018,18 +1018,16 @@
 ror);%0A  
- 
- 
 %7D else %7B
@@ -1027,20 +1027,16 @@
  else %7B%0A
-    
     // P
@@ -1122,20 +1122,16 @@
 n other%0A
-    
     // c
@@ -1142,20 +1142,16 @@
 ts)%0A    
- 
-   
 session.
@@ -1183,30 +1183,24 @@
 on(error) %7B%0A
-      
       if (er
@@ -1214,24 +1214,16 @@
         
- 
-       
 console.
@@ -1261,22 +1261,16 @@
 r);%0A
-      
       %7D%0A
     
@@ -1269,20 +1269,16 @@
   %7D%0A
-    
     %7D);%0A
     
@@ -1273,18 +1273,16 @@
     %7D);%0A
-  
   %7D%0A%7D);%0A

Update JS style: use 2 spaces, not 4