Tuesday, April 4, 2017

Get parameter from url

function getUrlParameter(paramName) {
    var currentUrl = window.location.search.substring(1);
    var urlParams = currentUrl.split("&");
    for (var i = 0; i < urlParams.length; i++) {
        var paramNames = urlParams[i].split("=");
        if (paramNames[0] == paramName) {
            return paramNames[1];
        }
    }
}