jasonglisson
7/28/2014 - 4:17 PM

Javascript - Get variable from URL

Javascript - Get variable from URL

		function getUrlVars() {
		    var vars = {};
		    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		        vars[key] = value;
		    });
		    return vars;
		}
		var first = getUrlVars()["varfromURL"];