Last active
August 29, 2015 14:25
-
-
Save monkianer/14b27cf95605799e2b42 to your computer and use it in GitHub Desktop.
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
/** Get parameter after query(ex:?p=1) sign. | |
* @param {string} parameter name. | |
*/ | |
var GetURLParameter = function(sParam){ | |
var oPageURL = window.location.href; | |
var sPageURL = oPageURL.split('?')[1]; | |
if(sPageURL == null){ | |
return; | |
} | |
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