Skip to content

Instantly share code, notes, and snippets.

@thirdj
Created September 26, 2013 08:08
Show Gist options
  • Save thirdj/6711217 to your computer and use it in GitHub Desktop.
Save thirdj/6711217 to your computer and use it in GitHub Desktop.
var getParam = function( name ) {
var result = '';
var thisUrl = unescape(location.href);
var params = thisUrl.substring(thisUrl.indexOf('?')+1).split('&');
for(var i = 0 ; i < params.length ; i++){
var keyValue = params[i].split('=');
if(keyValue[0].toUpperCase() == name.toUpperCase()){
result = keyValue[1];
break;
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment