Skip to content

Instantly share code, notes, and snippets.

@techkuz
Last active June 29, 2018 08:31
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 techkuz/9d2a5b83002ee8818ed95444349653ef to your computer and use it in GitHub Desktop.
Save techkuz/9d2a5b83002ee8818ed95444349653ef to your computer and use it in GitHub Desktop.
Js - get request parameter from current url
function getParam() {
var currUrl = window.location.href;
var url = new URL(currUrl);
var param = url.searchParams.get('param');
return param;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment