Skip to content

Commit

Permalink
using geturlparameter
Browse files Browse the repository at this point in the history
  • Loading branch information
millerti committed Mar 8, 2024
1 parent 1363c59 commit 49b2881
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit 49b2881

Please sign in to comment.