Anders and Briegel in Python
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

28 行
525B

  1. var ws;
  2. function add_node(node){
  3. data = {"method": "add_node", "node": node};
  4. ws.send(JSON.stringify(data));
  5. }
  6. function connect_to_server() {
  7. ws = new WebSocket("ws://localhost:5001");
  8. ws.onopen = function()
  9. {
  10. console.log("Connected to server.");
  11. };
  12. ws.onmessage = function (evt)
  13. {
  14. var received_msg = evt.data;
  15. console.log("Message received: " + evt.data);
  16. };
  17. ws.onclose = function()
  18. {
  19. console.log("Connection was closed.");
  20. };
  21. }