-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
45 lines (38 loc) · 1.02 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
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<title>Phaser Examples</title>
</head>
<body>
<script>
/**
* @see http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash
*
* @param {string} str
* @return {string}
*/
function removeTrailingSlash(str) {
return str.replace(/\/$/, '');
}
/**
* @return {string}
*/
function getRedirectUrl() {
var url = window.location.href;
var indexFileName = 'index.html';
if (url.indexOf(indexFileName) >= 0) {
url = url.replace(indexFileName, '');
}
url = removeTrailingSlash(url);
return url + '/games/index.html';
}
// redirect
var redirectUrl = getRedirectUrl();
window.location.href = redirectUrl;
</script>
</body>
</html>