-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
34 lines (34 loc) · 1.18 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>
<html>
<head>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script>
<script>
var socket = io('http://127.0.0.1:3001');
socket.on('pie', function(data) {
console.log(data);
});
socket.on('line', (data) => {
console.log(data);
})
socket.on('sub_bar',(data) => {
console.log(data);
})
socket.on('loc',(data) =>{
console.log(data);
})
socket.on('error', console.error.bind(console));
socket.on('message', console.log.bind(console));
function addMessage(message) {
var text = document.createTextNode(message),
el = document.createElement('li'),
messages = document.getElementById('messages');
el.appendChild(text);
messages.appendChild(el);
}
</script>
</head>
<body>
<ul id='messages'></ul>
</body>
</html>