Skip to content

Instantly share code, notes, and snippets.

@lgh06
Created April 1, 2016 07:13
Show Gist options
  • Save lgh06/68ca0c8f956c55e1ff5bf818f86ab5a3 to your computer and use it in GitHub Desktop.
Save lgh06/68ca0c8f956c55e1ff5bf818f86ab5a3 to your computer and use it in GitHub Desktop.
getQueryStringByName
function getQueryStringByName(name){
var result = location.search.match(new RegExp("[\?\&]" + name+ "=([^\&]+)","i"));
if(result == null || result.length < 1){
return "";
}
return result[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment