forked from heaversm/serial-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserialReceiver.html
More file actions
35 lines (28 loc) · 785 Bytes
/
Copy pathserialReceiver.html
File metadata and controls
35 lines (28 loc) · 785 Bytes
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
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Receive Serial Data</title>
</head>
<body>
<script src="js/lib/jquery-2.1.4.min.js" type="text/javascript"></script>
<!-- <script src="js/lib/socket.io-1.3.5.js" type="text/javascript"></script> -->
<script src="http://localhost:3000/socket.io/socket.io.js" type="text/javascript"></script>
<!-- <script src="http://localhost:3000/js/socket.io-1.3.5.js" type="text/javascript"></script> -->
<script>
var socket, socketData;
function init(){
initSockets();
}
function initSockets(){
socket = io.connect('http://localhost:3000');
socket.on('scanData',onScanData);
}
function onScanData(data){
socketData = data;
console.log('scanReceived',data);
}
init();
</script>
</body>
</html>