-
Notifications
You must be signed in to change notification settings - Fork 0
/
RogersCinema.html
56 lines (49 loc) · 1.65 KB
/
RogersCinema.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<script type="text/javascript">
function setDatesDropdown(){
var futureLength = 10;
var date = new Date();
for (var i = 0; i<futureLength; i++){
if(i == 0) { text = "Today" }
else { text = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear(); }
addOption(document.dropList.SelectDate, text, date);
date.setDate(date.getDate() + 1);
}
}
function addOption( selectBox, text, value ){
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = text;
selectBox.options.add(optn)
}
function goToShowTimes(fileName) {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", "marshfieldDates.txt", false);
xmlhttp.send();
response = xmlhttp.responseText;
responseArray = response.split("\n");
responseArray.forEach(goToAppropriatePage);
}
function goToAppropriatePage(value) {
var date = value.split("|");
if (date[0] == document.forms.dropList.SelectDate.value) {
window.location.href = date[1];
}
}
</script>
</head>
<body onload="setDatesDropdown()">
<form name="dropList" id="dropList" action="JavaScript:goToShowTimes('marshfieldDates.txt')">
<select name="SelectDate" id="SelectDate" onchange="this.form.submit()">
</select>
</form>
</body>
</html>