-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·52 lines (45 loc) · 1.44 KB
/
index.html
File metadata and controls
executable file
·52 lines (45 loc) · 1.44 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>V0224016</title>
<link rel="stylesheet" href="style2.css">
<script src="./browserMqtt.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script src="./jquery.min.js"></script>
<script src="./qrcode.js"></script>
<script type="text/javascript">
var client = mqtt.connect('mqtt://broker.hivemq.com:8000');
var qrcode = new QRCode("qrcode", {
text: "http://topweb-cycweb.rhcloud.com:8888",
width: 128,
height: 128,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});
$(document).ready(function() {
$('#button').on('click', function() {
$(this).toggleClass('on');
if ($(this).hasClass('on') == true) {
client.publish('/V0224016', '1');
console.log("1");
} else {
client.publish('/V0224016', '0');
console.log("0");
}
});
});
</script>
</head>
<body>
<section>
<a href="#" id="button"></a>
<span></span>
</section>
<h1>
<div id="qrcode"></div>
</h1>
</body>
</html>