Tuesday, August 28, 2012

How can i replace Space with %20 in javascript


Possible Duplicate:

jQuery / Javascript replace <space> in anchor link with %20



I am getting sParameter like this :


sParameter = document.getElementById(\'ddParameterType\').value;


If i am getting word like \"Test - Text\" as the ddParameterType item

then i am replacing the space in word like below:


sParameter = document.getElementById(\'ddParameterType\').value.replace(\"\",\"%20\");


but its returning a valur like %20Test - Text.

I need like Test%20-%20Text.


can anyone help.






Rating: 5 out of 5 based on 4 ratings



The post How can i replace Space with %20 in javascript appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/how-can-i-replace-space-with-%20-in-javascript.html

No comments:

Post a Comment