-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
53 lines (45 loc) · 1.07 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Neo4j PubNub</title>
<script src="index.js" charset="utf-8"></script>
<script src="https://cdn.pubnub.com/pubnub-3.7.13.min.js"></script>
<script src="jquery.js" charset="utf-8"></script>
<style>
#train-1{
margin: auto;
display: block;
text-align: center;
}
.available{
font-size: 50px;
}
#number{
font-size: 50px;
color: #006600;
}
</style>
</head>
<body>
<h1>Train Status</h1>
<h3>Delhi - Mumbai Train</h3>
<div id="train-1">
<span class="available"> Available Seats - <span id="number"></span></span>
</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
var pubnub = PUBNUB({
publish_key : 'demo',
subscribe_key : 'demo'
});
pubnub.subscribe({
channel : "neo4j",
message : function(message){
$("#number")[0].innerHTML = (JSON.stringify(message.seats_left));
}
})
});
</script>
</html>