function server_message(data){
	console.log("server message recieved");
	// grab chat_box div
	var chat_box = document.getElementById('chat_box');
	// debug
	console.log("recieved contents: " + data.contents)


	// create the element for displaying the message onto chat_box
	var element = document.createElement("p");
	var text = document.createTextNode(data.username + ": " + data.contents);
	element.appendChild(text);

	// append the element onto chat_box
	chat_box.appendChild(element);
}
// handles the input of messages back from the server to display them properly within html
handles the input of messages back from the server to display them properly within html
handles the input of messages back from the server to display them properly within html
function server_message(data){
	console.log("server message recieved");
	var chat_box = document.getElementById('chat_box');
	console.log("recieved contents: " + data.contents)
	var element = document.createElement("p");
	var text = document.createTextNode(data.username + ": " + data.contents);
	element.appendChild(text);
	chat_box.appendChild(element);
}
function server_message ( data ) { console . log ( "server message recieved" ) ; var chat_box = document . getElementById ( 'chat_box' ) ; console . log ( "recieved contents: " + data . contents ) var element = document . createElement ( "p" ) ; var text = document . createTextNode ( data . username + ": " + data . contents ) ; element . appendChild ( text ) ; chat_box . appendChild ( element ) ; }
handles the input of messages back from the server to display them properly within html
handles the input of messages back from the server to display them properly within html
// grab chat_box div // debug // create the element for displaying the message onto chat_box // append the element onto chat_box