-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
38 lines (37 loc) · 1.14 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
35
36
37
38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script>
dojoConfig={packages:[{name: 'my', location: 'my/socketio',main:'socketio'}]};
</script>
<script src="dojo/dojo.js"></script>
<script>
//load socket.io and connect to http://nodejs-ip:8889/notice
require(['my', 'dojo/domReady!'], function (socketio) {
// even though you are attempting to load socketio via AMD, because the code is not AMD, you
// will just access its global, as shown below
// another option would be to use https://github.com/bryanforbes/tube and only use the server-side
// of socket.io
//how access to var io
/*
try {
var socket = io.connect('http://nodejs-ip:8889/notice');
socket.on("connect", function () {
socket.emit("user", {
Id:"qwe"
})
});
socket.on('update', function (data) {
console.log(data);
});
} catch (e) {
console.log(e);
}
*/
});
</script>
</head>
<body>
</body>
</html>