Created
December 8, 2015 14:28
-
-
Save danwarfel/315abbd3ec1be2e0423d to your computer and use it in GitHub Desktop.
Get the Value of an URL Parameter From http://codesr.thewebflash.com/2014/09/get-value-of-url-parameter.html
This file contains hidden or 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, 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