From fd41aaae5888cc1c562df5dfd7f78bdde97970f6 Mon Sep 17 00:00:00 2001 From: moepoi Date: Sun, 21 Nov 2021 12:30:49 +0700 Subject: [PATCH] Update subscribe --- public/js/index.js | 9 ++++++++- views/pages/index.ejs | 18 ++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index c6a0ccc..530b58d 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -185,4 +185,11 @@ jQuery(document).ready(function ($) { } } } -}) \ No newline at end of file +}) + +function subscribe() { + let request = new XMLHttpRequest(); + let email = document.getElementById("newsletter_email").value; + request.open('GET', `api/subscribe?email=${email}`, false); + request.send(null); +} \ No newline at end of file diff --git a/views/pages/index.ejs b/views/pages/index.ejs index ce1bd80..a6386a7 100644 --- a/views/pages/index.ejs +++ b/views/pages/index.ejs @@ -561,16 +561,14 @@
-
- -
+