Last active
April 19, 2016 12:41
-
-
Save aegiz/04cd8f3a756082a479c784b46cfc7af4 to your computer and use it in GitHub Desktop.
Get query params 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
var getQueryParams = function(param){ | |
param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regexS = "[\\?&]"+param+"=([^&#]*)", | |
regex = new RegExp( regexS ), | |
results = regex.exec( window.location.href); | |
return results === null ? false : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment