function on_message(m) {
    console.log("Having messages");
    var msg = JSON.parse(m.body);
    var users = msg.users;
    for (var i=0;i < users.length; i++) {
        document.getElementById("username"+(i+1)).innerHTML = users[i].username;
        document.getElementById("points"+(i+1)).innerHTML = users[i].score;
    }
    
}
// This will be called upon arrival of a message
This will be called upon arrival of a message
This will be called upon arrival of a message
function on_message(m) {
    console.log("Having messages");
    var msg = JSON.parse(m.body);
    var users = msg.users;
    for (var i=0;i < users.length; i++) {
        document.getElementById("username"+(i+1)).innerHTML = users[i].username;
        document.getElementById("points"+(i+1)).innerHTML = users[i].score;
    }
}
function on_message ( m ) { console . log ( "Having messages" ) ; var msg = JSON . parse ( m . body ) ; var users = msg . users ; for ( var i = 0 ; i < users . length ; i ++ ) { document . getElementById ( "username" + ( i + 1 ) ) . innerHTML = users [ i ] . username ; document . getElementById ( "points" + ( i + 1 ) ) . innerHTML = users [ i ] . score ; } }
This will be called upon arrival of a message
This will be called upon arrival of a message