Created
October 9, 2013 14:58
-
-
Save pierreandreroy/6902634 to your computer and use it in GitHub Desktop.
Get URL parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURLParameter(sParam){ | |
var sPageURL = window.location.search.substring(1); | |
var sURLVariables = sPageURL.split('&'); | |
for (var i = 0; i < sURLVariables.length; 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