Convert %20 to space

How do I convert %20 in the two results to spaces (spaces instead of %20)?
<script type="text/javascript">
var query = location.search;
query = (query)? query.substring(1):"";
var queryqu = query.split('&')
var querysplit = new Array();
for (var i=0;i<1;i++) {
var queryValue = queryqu[i].split('=');
if (queryValue[0]) querysplit[queryValue[0]] = unescape(queryValue[1]);
if (queryValue[1] == null) 
   var queryValue1 = " "
else
  var queryValue1=queryValue[1];
}
 
var queryValue3 = " ";
var query2 = location.search;
query2 = (query2)? query2.substring(1):"";
var query2qu = query2.split('&')
var query2split = new Array();
for (var i=0;i<2;i++) {
var query2Value = query2qu[i].split('=');
if (query2Value[0]) query2split[query2Value[0]] = unescape(query2Value[1]);
if  (query2Value[1] == null) 
    var queryValue2 = " "
  	  else {
  		var queryValue2=query2Value[1];
  		var queryValue3=": "; 
   }
}
 
</script>

Open in new window

LVL 1
net_susanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HonorGodSoftware EngineerCommented:
Use decode()

0
HonorGodSoftware EngineerCommented:
e.g.,

  queryValue1 = decode( queryValue[ 1 ] );
0
the_crazedCommented:
alter you code to use "unescape" everwhere, its currently missing in a couple of places.

the code is a bit unclear to me, what are you trying to do? get the first and second args from the querystring?
<script type="text/javascript">
var query = location.search;
query = (query)? query.substring(1):"";
var queryqu = query.split('&')
var querysplit = new Array();
for (var i=0;i<1;i++) {
var queryValue = queryqu[i].split('=');
if (queryValue[0]) querysplit[queryValue[0]] = unescape(queryValue[1]);
if (queryValue[1] == null) 
   var queryValue1 = " "
else
  var queryValue1=unescape(queryValue[1]);
}
 
var queryValue3 = " ";
var query2 = location.search;
query2 = (query2)? query2.substring(1):"";
var query2qu = query2.split('&')
var query2split = new Array();
for (var i=0;i<2;i++) {
var query2Value = query2qu[i].split('=');
if (query2Value[0]) query2split[query2Value[0]] = unescape(query2Value[1]);
if  (query2Value[1] == null) 
    var queryValue2 = " "
  	  else {
  		var queryValue2=unescape(query2Value[1]);
  		var queryValue3=": "; 
   }
}
 
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

net_susanAuthor Commented:
I tried it just like that and it didn't work.
0
net_susanAuthor Commented:
Sorry, my last comment was about decode. I'm trying the next thing now.
0
net_susanAuthor Commented:
>>the code is a bit unclear to me, what are you trying to do? get the first and second args from the querystring?

Yes.
0
net_susanAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.