I am using the following javascript to get URL parameters ...
function getUrlParams() {
var params = {};
window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str,key,value) {
params[key] = value;
});
return params;
}
var params = getUrlParams();
var urlvars = (params.email);
URL has ?email=email@domain.com&fbemail=email@domain.com
In most cases, one of these values ββis empty, otherwise they are the same. Therefore i try to dourlvars = (params.email) or (params.fbemail)
What is the best way to do this?
source
share