PDA

Click to See Complete Forum and Search --> : Substitution of " " with "%20" in JS


hpl
May 6th, 2002, 07:29 AM
I want to substitute a variable including " " with "%20" so I can use it in a link. How do I do that with a JS-function?

function subs(){
var strName= "This is the test";
}

And my result should be
"This%20ís%20the%20test"

chrisjk
May 6th, 2002, 08:42 AM
try this perhaps

http://summerholiday.org/freecode/JavaScript_URL_Encode.html