-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (63 loc) · 2.25 KB
/
index.html
File metadata and controls
84 lines (63 loc) · 2.25 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<head>
<script src="offline.min.js"></script>
<!--
Themes:
<link rel="stylesheet" href="./themes/offline-theme-default.css" />
<link rel="stylesheet" href="./themes/offline-theme-default-indicator.css" />
<link rel="stylesheet" href="./themes/offline-theme-slide.css" />
<link rel="stylesheet" href="./themes/offline-theme-slide-indicator.css" />
<link rel="stylesheet" href="./themes/offline-theme-chrome.css" />
<link rel="stylesheet" href="./themes/offline-theme-chrome-indicator.css" />
<link rel="stylesheet" href="./themes/offline-theme-hubspot.css" />
-->
<link rel="shortcut icon" type="image/png" href="favicon.ico"/>
<link rel="stylesheet" href="offline-theme-default.css" />
<link rel="stylesheet" href="offline-language-english.css" />
<script type="text/javascript">
Offline.options = {
// to check the connection status immediatly on page load.
checkOnLoad: true,
// to monitor AJAX requests to check connection.
interceptRequests: true,
// to automatically retest periodically when the connection is down (set to false to disable).
reconnect: {
// delay time in seconds to wait before rechecking.
initialDelay: 3,
// wait time in seconds between retries.
delay: 5
},
// to store and attempt to remake requests which failed while the connection was down.
requests: true,
game: false
};
// var run = function(){
// // only check when state is up, if state is down, reconnect will take over
// if(Offline.state=="up")
// Offline.check();
// };
// setInterval(run, 20000); // check after 20sec
// Offline.on('down',function(){
// alert("connection Down");
// /**code to handle network down*/ });
var delay = 1000;
Offline.on('confirmed-down', function () {
console.log('down');
});
Offline.on('confirmed-up', function () {
console.log('up');
});
setTimeout(function retry() {
Offline.check();
setTimeout(retry, delay);
}, delay);
// console.log(Offline.check());
// Offline.on("up",function () {
// console.log("connected");
// });
// Offline.on("down", function () {
// console.log("disconnected");
// });
</script>
</head>
<body>
</body>