Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing %20 value from get method

Removing %20 in get method?

var c=new Array(a);    
(eg: a={"1","2"})  window.location="my_details.html?"+  c + "_";  

and in my_details.html :

var q=window.location.search;    
alert("qqqqqqqqqqqqq " + q);   
var arrayList = (q)? q.substring(1).split("_"):[];      
var list=new Array(arrayList);    
alert("dataaaaaaaaaaaa " +  list  + "llll " ); 

and in "list" its dusplaying me "1%202";

How can I remove this %20 =space value ??

Thanks

like image 271
Smitha Avatar asked Dec 19 '11 08:12

Smitha


1 Answers

just use this:

alert("dataaaaaaaaaaaa " +  decodeURIComponent(list)  + "llll " );

This should decode the %20 to space

look here: http://www.w3schools.com/jsref/jsref_decodeURIComponent.asp

like image 79
evildead Avatar answered Oct 03 '22 04:10

evildead