Skip to content

Instantly share code, notes, and snippets.

@nuriye
Created September 25, 2019 07:29
Show Gist options
  • Save nuriye/cd03a35514c0a34f9875a384f64e36d9 to your computer and use it in GitHub Desktop.
Save nuriye/cd03a35514c0a34f9875a384f64e36d9 to your computer and use it in GitHub Desktop.
function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment