From 0581c63c0ffc30b0db3d13f98c4eac621f9c2a38 Mon Sep 17 00:00:00 2001
From: Rosanny <rosanny.sihombing@hft-stuttgart.de>
Date: Wed, 13 Oct 2021 15:39:03 +0200
Subject: [PATCH] add a new function

---
 js/generalFunction.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/js/generalFunction.js b/js/generalFunction.js
index 5aeafdc..4a101d2 100644
--- a/js/generalFunction.js
+++ b/js/generalFunction.js
@@ -6,4 +6,15 @@ function checkPasswordReq(pwd) {
         isBest = true;
     }
     return isBest
+}
+
+// to get the queries of the URL
+function getQueryStringParams(params, url) {
+    // first decode URL to get readable data
+    var href = decodeURIComponent(url || window.location.href);
+    // regular expression to get value
+    var regEx = new RegExp('[?&]' + params + '=([^&#]*)', 'i');
+    var value = regEx.exec(href);
+    // return the value if exist
+    return value ? value[1] : null;
 }
\ No newline at end of file
-- 
GitLab