Last active
June 29, 2018 08:31
-
-
Save techkuz/9d2a5b83002ee8818ed95444349653ef to your computer and use it in GitHub Desktop.
Js - get request parameter from current url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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