function update_ui() {
    var msg = '';
    if (conn == null || conn.readyState != SockJS.OPEN) {
        $('#status').text('disconnected');
        $('#connect').text('Connect');
    } else {
        $('#status').text('connected (' + conn.protocol + ')');
        $('#connect').text('Disconnect');
    }
  }
//when conn have message or status change, update
when conn have message or status change, update
when conn have message or status change update
function update_ui() {
    var msg = '';
    if (conn == null || conn.readyState != SockJS.OPEN) {
        $('#status').text('disconnected');
        $('#connect').text('Connect');
    } else {
        $('#status').text('connected (' + conn.protocol + ')');
        $('#connect').text('Disconnect');
    }
  }
function update_ui ( ) { var msg = '' ; if ( conn == null || conn . readyState != SockJS . OPEN ) { $ ( '#status' ) . text ( 'disconnected' ) ; $ ( '#connect' ) . text ( 'Connect' ) ; } else { $ ( '#status' ) . text ( 'connected (' + conn . protocol + ')' ) ; $ ( '#connect' ) . text ( 'Disconnect' ) ; } }
when conn have message or status change, update
when conn have message or status change update