Skip to content

Instantly share code, notes, and snippets.

@artemsites
Last active April 24, 2024 05:38
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 artemsites/8d260ef1682d10c70c2cf1cd256c629d to your computer and use it in GitHub Desktop.
Save artemsites/8d260ef1682d10c70c2cf1cd256c629d to your computer and use it in GitHub Desktop.
/**
* @source https://gist.github.com/artemsites/8d260ef1682d10c70c2cf1cd256c629d
*/
export default function getParamFromUrlSearch(paramName) {
if (location.search) {
let params = location.search.split('?')[1].split("&")
let param = params.find(p=>p.includes(paramName))
if (param) return param.split('=')[1]
return false
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment