javascript/index.js
//this method is called when the server gives the user his ID (ready to start transmiting)
this method is called when the server gives the user his ID (ready to start transmiting)
this method is called when the server gives the user his ID ( ready to start transmiting )
function resp_on_ready(id){
  	console.log("user id is %s",id); 
  	this.userid = id;
	console.log("typeof(this.userid) = %s",typeof(this.userid))
	console.log("this.userid = %d",this.userid)
	if(this.roomid == master_room_id){
		update_room_list(this);
	}
	UserInfor[id] = login_user_name;
	var msg_obj = {"type": "user_infor", "user_id": null, "user_name":null};
	msg_obj.user_id = id;
	msg_obj.user_name = login_user_name;
	this.sendMessage(JSON.stringify(msg_obj));
	setTimeout(active_room_display,250,active_room_name);
	if(active_room_name != null){
		setTimeout(trigger_room_infor,200,this);
	}
	setTimeout(trigger_room_infor,280,this);
}
function resp_on_ready ( id ) { console . log ( "user id is %s" , id ) ; this . userid = id ; console . log ( "typeof(this.userid) = %s" , typeof ( this . userid ) ) console . log ( "this.userid = %d" , this . userid ) if ( this . roomid == master_room_id ) { update_room_list ( this ) ; } UserInfor [ id ] = login_user_name ; var msg_obj = { "type" : "user_infor" , "user_id" : null , "user_name" : null } ; msg_obj . user_id = id ; msg_obj . user_name = login_user_name ; this . sendMessage ( JSON . stringify ( msg_obj ) ) ; setTimeout ( active_room_display , 250 , active_room_name ) ; if ( active_room_name != null ) { setTimeout ( trigger_room_infor , 200 , this ) ; } setTimeout ( trigger_room_infor , 280 , this ) ; }
this method is called when the server gives the user his ID (ready to start transmiting)
this method is called when the server gives the user his ID ( ready to start transmiting )
//user has an ID //get report // in the function get all room info and to call the show function //send username infor to the chatroom //this.getRoomInfo( this.roomid, function(room_info) {console.log("inner getRoomInfo callback function ") ;console.log(JSON.stringify(room_info)) ;} );