vhlongon
4/25/2015 - 3:00 PM

From http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript get url parameters with javascript

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}