Category archives: Python

RSS feed of Python

Last update on .


Subscribing to the chat room.

Insert input box and button in our template

                <button id="subscribe" class="but">Subscribe</button>
                <input type="text" id="room"  /> room name

Bind this button to new function.

            $("#subscribe").click(function(){
                sock.send_message({ action: 'connect', user_id: $("#room").val(), source: 'chat_side' })
            });

Create new function 'send_message' inside websocket object.

            $("#connect").click ...