Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Last active October 2, 2015 11:41
Show Gist options
  • Save iampeterbanjo/5e0e2fa6feb972e72929 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/5e0e2fa6feb972e72929 to your computer and use it in GitHub Desktop.
// modified version of http://www.guffa.com/Programming_archive.aspx?id=16
var getQuerystring = function (key, from){
var re = new RegExp('(?:\\?|&)'+key+'=(.*?)(?=&|$)','gi')
, r = []
, m
;
while ((m=re.exec(from)) != null) r.push(m[1]);
return (r.join(',') || '').replace('/','');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment