Last active
November 30, 2017 07:42
-
-
Save gilchris/c17e8a0a2ecb7a09b2edf977c5c3ad57 to your computer and use it in GitHub Desktop.
get parameter value from url
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
// https://stackoverflow.com/a/35430091/1615988 | |
function getQuery(q) { | |
return (window.location.href.match(new RegExp('[?&]' + q + '=([^&]+)')) || [, null])[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment