summaryrefslogtreecommitdiff
path: root/modules/lijst/lijst.html
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-07-10 21:22:48 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-07-10 21:22:48 +0200
commitba048a22078bfc7a88c79020447e8cda47cd7f40 (patch)
treeeb08ccb89b7ace0342859a6b226ab34f48d03e81 /modules/lijst/lijst.html
parent3845bf7c3218a644b0804e9080b5a5c9ef1489f1 (diff)
Add module 'lijst'
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>