anchor.diff:  		chatbox.innerHTML += "Channel closed<br>";
       };        
    
  -    function send(type) {
  +    function send(type, onreadystate) {
       	var userInput = document.getElementById('userInput').value;
       	var roomName = document.getElementById('roomname').innerHTML;
   		
       	var xhr = new XMLHttpRequest();
  +    	xhr.onreadystatechange = onreadystate;
       	xhr.open('POST', "/channel/"+type+"?message="+userInput+"&roomname="+roomName, true);
       	xhr.send();
       	document.getElementById('userInput').value = '';
       };
       
       function leaveRoom() {
  -    	send("leave");
  +    	send("leave", function () {window.location.replace('/')});
       };
       
       $('#upload_file').submit(function() { 
  
positive.code: 	var chatbox=document.getElementById('chatbox');	
  	socket.onopen=function() { 
  		//chatbox.innerHTML +="Channel opened<br>";
  		send("join")
  		};
  		
      socket.onmessage=function(message){
  
negative.code: 			<b>Nick:</b> <span id='username'><%= username %></span>
  		</div>
  		<div class="col-lg-4">
  			<button class="btn btn-default" onclick="leaveRoom()">
  				Leave Room
  			</button>
  		</div>
  