if(name == null || name.length==0){ alert('Please enter a username!'); }else{ if(this.isPrivate){ this.roomId = name; } this._username=name; this.joining.className='hidden'; this.joined.className=''; this.phrase.focus(); console.log(this.roomId); dojox.cometd.subscribe("/chat/demo/" + this.roomId, this, "_chat"); dojox.cometd.publish("/chat/demo/" + this.roomId, { user: this._username, join: true, chat : this._username+" has joined the room."}); dojox.cometd.publish("/chat/demo", { user: this._username, joined: this.roomId }); }