decode html query string in javascript using replace function

hey i need a regular expression to pass into the jscript replace function.

all i'm trying to do is replace the %20 from the query string that gets passed over with the space that was originally there.  

thanks
das165227Asked:
Who is Participating?
 
darksinclairCommented:
Could you just use strQuery = strQuery.split("%20").join(" "); ?
0
 
das165227Author Commented:
yeah that works too.  

i'm curious as to why this won't work though if anyone wants to post for the hek of it and since its pretty simple.  

var regExpression= /%20/;
text= text.replace(regExpression," ");
0
 
darksinclairCommented:
I'm not 100% sure on regular expressions.. but from what I know I think this is close to trim white spaces...

 var objRegExp = /^(\s*)$/;
0
 
das165227Author Commented:
i'm not wanting one to trim white spaces.  i was wanting one to look for the %20 in the jscript replace function.  i thought the code you gave me earlier worked but theres a problem with it somewhere.  i'm not sure where but its messing the html up somewhere that i'm passing over through the query string.  i'll post the question again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.