Removing %20 from URL parameters
<p>I know you need to use some variant of decodeURIComponent() to do something like this, but since I'm still fairly new to coding and using some code I found on the net for my purposes, I'm not sure how to go about changing it to suit my needs.</p>

<p>What I have is a function that gets each URL parameter I need out of the URL (of which there are many). I have to use these variables for other functions as parameters and also to display on the page, and I can't get the %20's to disappear.</p>

<pre><code>function getUrlVars() {
            var vars = {};
            parts = window.location.href.replace(/[?&amp;]+([^=&amp;]+)=([^&amp;]*)/gi, function(m,key,value) {
            vars[key] = value;
            });
            return vars;
        }
</code></pre>

<p>Where I get each variable using:</p>

<pre><code>var markname = getUrlVars()["mname"];
</code></pre>

<p>I've tried to put decodeURIComponent() in different places in that function, but I can't seem to get it to work. I'm also not sure if it needs to use value or vars.</p>

<pre><code>value = decodeURIComponent(value);
</code></pre>

<p>Or something like that...</p>

<p>Any help would be appreciated! Thanks!</p>
