-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (56 loc) · 2.09 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
54
55
56
57
58
59
60
61
<html>
<head>
<title>DID YOU KNOW THAT?</title>
<link rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" href="css/index.css" />
<!--For Facebook-->
<meta name="title" content="DID YOU KNOW THAT?" />
<meta name="description" content="NOW YOU KNOW" />
</head>
<body>
<!--TODO(jwcarlso): Register for Google Analytics and insert script code-->
<div class="sitetitle">DID YOU KNOW THAT?</div>
<div class="sitefacts" id="factoid"></div>
<div class="sitesubtitle">NOW YOU KNOW</div>
</body>
</html>
<script type="text/javascript">
var QueryString = function () {
console.log("running");
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [query_string[pair[0]], decodeURIComponent(pair[1])];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
console.log("ending");
console.log(query_string);
return query_string;
}();
window.onload = function () {
var dyktAudio = new Audio('content\\DidYouKnowThat.m4a');
dyktAudio.play();
setTimeout(function () {
NowYouKnow();
}, 3000);
console.log(QueryString.fact);
document.getElementById('factoid').appendChild(document.createTextNode(QueryString.fact));
}
function NowYouKnow(){
var nykAudio = new Audio('content\\NowYouKnow.m4a');
nykAudio.play();
}
</script>