Last active
August 29, 2015 14:21
-
-
Save BuddyLReno/bb6b83812f4fc78fb4eb to your computer and use it in GitHub Desktop.
Finds query string parameters and returns them.
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
function getUrlParameter(parameterName) { | |
var results = new RegExp('[\?&]' + parameterName + '=([^&#]*)').exec(window.location.search); | |
if (results === null) { | |
return ""; | |
} else { | |
return results[1] || ""; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment