Last active
August 29, 2015 14:17
-
-
Save russianryebread/f11c6518988aeef8ad9c to your computer and use it in GitHub Desktop.
Parses the URL Query String in 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
function getQueryVariable(qvar) { | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
var len = vars.length; | |
for (var i=0;i<len;i++) { | |
var kv = vars[i].split("="); | |
if(kv[0] == qvar){return kv[1];} | |
} | |
return(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment