Last active
April 24, 2024 05:38
-
-
Save ArtemSites/8d260ef1682d10c70c2cf1cd256c629d to your computer and use it in GitHub Desktop.
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
/** | |
* @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