How to replace plus (+) signs with spaces ( ) in GET parameters with javascript
问题 I get users redirected to my site with GET parameters like this: www.example.com/?email=mail@mail.com&vorname=name1+name2 I use javascript to populate my texfields (newsletter subscription) like this: function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } function getUrlParam(parameter, defaultvalue){ var urlparameter = defaultvalue; if(window.location.href.indexOf(parameter) > -1