Skip to content

Instantly share code, notes, and snippets.

@ArtemSites
Last active April 24, 2024 05:38
Show Gist options
  • 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