Skip to content

Instantly share code, notes, and snippets.

@phalkunz
Last active February 1, 2022 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phalkunz/c393244aa327fdca5c7b81678343812e to your computer and use it in GitHub Desktop.
Save phalkunz/c393244aa327fdca5c7b81678343812e to your computer and use it in GitHub Desktop.
function getQueryParam(name) {
window.location.search
const paramStr = window.location.search.substr(1).split('&').find(param => param.includes(`${name}=`));
const nameValue = paramStr.split('=');
if (nameValue.length === 2) {
return nameValue[1];
}
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment