Created
August 21, 2013 08:58
-
-
Save davidlonjon/6292014 to your computer and use it in GitHub Desktop.
JavaScript: Get URL Parameter
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
// Taken from: | |
// http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery | |
getURLParameter = function(paramName) { | |
return decodeURIComponent((new RegExp('[?|&]' + paramName + '=' + '([^&;]+?)(&|#|;|$)').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