Plug and go , just add ?date=2017-01-02 to the url
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; var tech = getUrlParameter('date'); alert(tech); |