document.execCommand("defaultParagraphSeparator", false, "br"); var socket; var tid = setInterval( function () { if ( document.readyState !== 'complete' ) return; clearInterval( tid ); document.getElementById('chatWindow').scrollTop = document.getElementById('chatWindow').scrollHeight; socket = io.connect('https://' + document.domain + ':' + location.port); socket.on('connect', function() { socket.emit('joined', {room: room_id}); }); socket.on('message', function(data) { let msg_str = '
'; post_str += ' | '; post_str += '' + data.options[i][1] + ' | '; post_str += '0 |