summaryrefslogtreecommitdiffhomepage
path: root/html/index.html
blob: a27b654b6d6f6deafe62dff51a0621ffbab37791 (plain)
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
<!DOCTYPE html>
<html>
	<head>
		<title>MIDIPLAY</title>

<style>
.button{
	width: 200px;
	height: 150px;
	font-size: 20px;
}
</style>
<script type="text/javascript">
	function playbutton_clicked()
	{
		var element = document.getElementById("playbutton");
		if (element.innerHTML == "Play") {
			element.innerHTML = "Stop";
		} else {
			element.innerHTML = "Play";
		}

          var xhr = new XMLHttpRequest();

          xhr.onreadystatechange = function() {
                        if (this.readyState != 4) {
                                return;
                        }
                        if (this.status != 200) {
                                document.getElementById("status").innerHTML = "HTTP error";
                        } else {
                          var xml = xhr.responseXML;
                          var value = xml.getElementsByTagName("value1")[0].childNodes[0].nodeValue;
                          document.getElementById("songlist").innerHTML = value;
                        }
          }

          xhr.open("POST", "midiplay.fcgi" + "?command=list", true);
          xhr.setRequestHeader("Content-type", "text/xml");
          xhr.send("<data><value1>3</value1></data>");
	}

	function startup() {
		document.getElementById("playbutton").onclick = playbutton_clicked;

		document.getElementById("songlist").innerHTML = "01 Locked Out Of Heaven";
	}

</script>
	</head>
	<body onload="startup();">
MIDIPLAY

<br/>
<br/>
<div id="songlist">
</div>
<br/>
<br/>
<button id="playbutton" class="button">Play</button>

	</body>
</html>