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

21
LINES

< > BotCompany Repo | #1013377 // Test ReconnectingWebSocket [Dyn, OK]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1937L/13K/44K).

1  
!7
2  
3  
html {
4  
  ret htitle("Live Webs Count")
5  
    + hfullcenter("Live webs count:<br><br>"
6  
    + hloadjquery()
7  
    + hdiv("bla<br>", id := "bla", style := "font-size: 40px")
8  
    + hjavascript_src_snippet(#1013374 /*#1013375*/) // ReconnectingWebSocket
9  
    + hjavascript([[
10  
        var ws = new ReconnectingWebSocket("ws://smartbot.botcompany.de/");
11  
        ws.onopen = function(event) {
12  
          //ws.send("Here is an important message!");
13  
          ws.send("stream-big-number");
14  
          $("#bla").append("Streaming...<br>");
15  
        };
16  
        ws.onmessage = function(event) {
17  
          $("#bla").html(event.data);
18  
          document.title = event.data;
19  
        };
20  
    ]]));
21  
}

Author comment

Began life as a copy of #1013356

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013377
Snippet name: Test ReconnectingWebSocket [Dyn, OK]
Eternal ID of this version: #1013377/6
Text MD5: e0b3de1e30a685adc33262bc0678a94b
Transpilation MD5: 17f7addd7de242f848ea64c099f51521
Author: stefan
Category: javax / networking
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-03 22:30:32
Source code size: 697 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 378 / 517
Version history: 5 change(s)
Referenced in: [show references]