diff --git a/assets/scripts/main.js b/assets/scripts/main.js index f947419..a668960 100644 --- a/assets/scripts/main.js +++ b/assets/scripts/main.js @@ -8,3 +8,19 @@ document.addEventListener('DOMContentLoaded', (event) => { document.title = `Secret: ${secret}`; } }); + +var getUrlParameter = function getUrlParameter(sParam) { + var sPageURL = window.location.search.substring(1), + sURLVariables = sPageURL.split('&'), + sParameterName, + i; + + for (i = 0; i < sURLVariables.length; i++) { + sParameterName = sURLVariables[i].split('='); + + if (sParameterName[0] === sParam) { + return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); + } + } + return false; +};