Skip to content

Instantly share code, notes, and snippets.

@danwarfel
Created December 8, 2015 14:28
Show Gist options
  • Save danwarfel/315abbd3ec1be2e0423d to your computer and use it in GitHub Desktop.
Save danwarfel/315abbd3ec1be2e0423d to your computer and use it in GitHub Desktop.
function getURLParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0, len = sURLVariables.length; i < len; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment