summaryrefslogtreecommitdiff
path: root/modules/lijst/lijst.html
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lijst/lijst.html')
-rw-r--r--modules/lijst/lijst.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/lijst/lijst.html b/modules/lijst/lijst.html
new file mode 100644
index 0000000..0c1a3dd
--- /dev/null
+++ b/modules/lijst/lijst.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Lijst</title>
+<script>
+function addItem() {
+ var text = document.getElementById("text").value;
+
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", location.href + "/add");
+ xhr.responseType = "text";
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ location.href = location.href;
+ }
+ };
+ xhr.send(text);
+}
+
+function removeItem() {
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", location.href + "/remove");
+ xhr.responseType = "text";
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ location.href = location.href;
+ }
+ };
+ xhr.send();
+}
+</script>
+<style>
+
+</style>
+</head>
+<body>
+<ol id="lijst">
+<!--[[LIJST_ITEMS]]-->
+</ol>
+<input type="text" id="text" placeholder="New item text">
+<input type="button" onclick="addItem()" value="Add item"><br>
+<br>
+<input type="button" onclick="removeItem()" value="Remove top item">
+</body>
+</html>