consik/yii2-websocket

Nothing happen after

Closed this issue · 1 comments

capture
Neither I can set user name nor I can send message. I try to console

chat.send( JSON.stringify({'action' : 'chat', 'message' : $('#message').val()}) );
chat.send( JSON.stringify({'action' : 'setName', 'name' : $('#username').val()}) )

both are undefined. And I more I have view page chart in place of chat Why?

In example variable "chat" initialized in $(function() { ..here..} ) and you can't call its methods outside from console.