How can i replace Space with %20 in javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/853804/jquery-javascript-replace-space-in-anchor-link-with-20">jQuery / Javascript replace &lt;space&gt; in anchor link with %20</a>  </p>
</blockquote>



<p>I am getting sParameter like this :</p>

<p><code>sParameter = document.getElementById('ddParameterType').value;</code></p>

<p>If i am getting word like <code>"Test - Text"</code> as the ddParameterType item <br/>then i am replacing the space in word   like below:</p>

<p><code>sParameter = document.getElementById('ddParameterType').value.replace("","%20");</code></p>

<p>but its returning a valur like <code>%20Test - Text</code>.<br/> I need like <code>Test%20-%20Text</code>.</p>

<p>can anyone help.</p>
