Skip to content

Instantly share code, notes, and snippets.

@doceazedo
Created July 21, 2021 02:18
Show Gist options
  • Save doceazedo/9ceb54f88aa9a47494b30aab8281862e to your computer and use it in GitHub Desktop.
Save doceazedo/9ceb54f88aa9a47494b30aab8281862e to your computer and use it in GitHub Desktop.
get-function.js
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