Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1030264 // js_evalOnWebSocketMessage

JavaX fragment (include)

1  
sS js_evalOnWebSocketMessage() {
2  
  ret [[
3  
    function(event) {
4  
      var data = JSON.parse(event.data);
5  
      if (data.eval) {
6  
        if (wsVerbose) console.log("Evaluating: " + data.eval);
7  
        var geval = eval; // use global scope
8  
        geval(data.eval);
9  
        if (wsVerbose) console.log("Evaluated.");
10  
      } else
11  
        if (wsVerbose) console.log("WebSocket incoming: " + event.data);
12  
    }
13  
  ]];
14  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030264
Snippet name: js_evalOnWebSocketMessage
Eternal ID of this version: #1030264/8
Text MD5: 7fea7358813edb85a05c0dc07fa40237
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-18 17:49:10
Source code size: 426 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 262 / 305
Version history: 7 change(s)
Referenced in: [show references]