summaryrefslogtreecommitdiff
path: root/webroot
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2020-12-24 12:17:46 +0100
committerxengineering <mail2xengineering@protonmail.com>2020-12-24 12:17:46 +0100
commit65713a14a0596a3493ca60696121c69b1e872b8c (patch)
tree105011910f48fb045a8a9775c568354824b3b80b /webroot
parenta46322e7fdb8e83edc3e4dc6f254973e9f694156 (diff)
downloadweb-template-65713a14a0596a3493ca60696121c69b1e872b8c.tar
web-template-65713a14a0596a3493ca60696121c69b1e872b8c.tar.zst
web-template-65713a14a0596a3493ca60696121c69b1e872b8c.zip
Add dynamic Functionality
Diffstat (limited to 'webroot')
-rw-r--r--webroot/index.html3
-rw-r--r--webroot/js/example.js14
-rw-r--r--webroot/template.html28
3 files changed, 17 insertions, 28 deletions
diff --git a/webroot/index.html b/webroot/index.html
index 59922a2..a406de7 100644
--- a/webroot/index.html
+++ b/webroot/index.html
@@ -20,8 +20,11 @@
<div class="xcontent">
<h1>Web Template</h1>
+ <button onclick="example_post()">Call JS Function</button>
</div>
+ <script src="js/example.js"></script>
+
</body>
</html>
diff --git a/webroot/js/example.js b/webroot/js/example.js
new file mode 100644
index 0000000..59cf1ee
--- /dev/null
+++ b/webroot/js/example.js
@@ -0,0 +1,14 @@
+
+function example_post() {
+
+ var data = {
+ "key":"value",
+ }
+ var json = JSON.stringify(data);
+
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", "api", true);
+ xhr.send(json);
+
+}
+
diff --git a/webroot/template.html b/webroot/template.html
deleted file mode 100644
index 59922a2..0000000
--- a/webroot/template.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-
- <head>
-
- <title>Web Template</title>
-
- <meta charset="utf-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="css/xengineering.css" type="text/css">
-
- </head>
-
- <body>
-
- <div class="xmenu">
- <a href="https://example.com">HOME</a>
- </div>
-
- <div class="xcontent">
- <h1>Web Template</h1>
- </div>
-
- </body>
-
-</html>
-