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?
 
the_crazedConnect With a Mentor Commented:
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
 
HonorGodCommented:
Use decode()

0
 
HonorGodCommented:
e.g.,

  queryValue1 = decode( queryValue[ 1 ] );
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.