forked from yuhuage/dizhi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
31 lines (30 loc) · 666 Bytes
/
index.html
File metadata and controls
31 lines (30 loc) · 666 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
<!DOCTYPE html>
<html>
<head>
<script>
function ifUp(url,onUp,onDown) {
// make random string
var RANDOM_DIGITS = 7; // this is sufficient. Don't do more than ~12.
var pow = Math.pow(10,RANDOM_DIGITS);
var randStr = String(Math.floor(Math.random()*pow)+pow).substr(1);
// create and load image
var img = new Image();
img.onload = onUp;
img.onerror = onDown;
img.src = url+"?"+randStr;
}
ifUp("https://www.yuhuage23.xyz/favicon.ico",
function(){
// do something
window.location.href="https://www.yuhuage23.xyz";
},
function(){
// do something else
window.location.href="https://www.yuhuage23.xyz";
}
);
</script>
</head>
<body>
</body>
</html>