js check for url parameter
const params = new URLSearchParams(window.location.search);
// Check if we have the param
if (params.has("myParam")) {
console.log("Yep! We have it. Value is: " + params.get("myParam"));
} else {
console.log("The param myParam is not present.");
}
js get url parameter
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const code = urlParams.get('code')
|