Created
July 21, 2021 02:18
-
-
Save doceazedo/9ceb54f88aa9a47494b30aab8281862e to your computer and use it in GitHub Desktop.
get-function.js
This file contains 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
const $_GET = param => { | |
let result = null, tmp = []; | |
location.search.substr(1).split('&').forEach(item => { | |
tmp = item.split('='); | |
if (tmp[0] === param) result = decodeURIComponent(tmp[1]); | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment