Created
January 6, 2015 14:23
-
-
Save TRex22/c29df184ba6016ae1e31 to your computer and use it in GitHub Desktop.
Code from StackOverflow to pull out url query strings in pure JavaScript
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
//http://stackoverflow.com/questions/11582512/how-to-get-url-parameters-with-javascript/11582513#11582513 | |
function getURLParameter(name) { | |
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [,""])[1].replace(/\+/g, '%20')) || null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment