replace spaces for %20 in javascript
Posted: Thu Aug 11, 2011 12:23 pm
				
				I am fairly new to Switch.
	
I am trying to retrieve an url from a xml file and then replace the spaces with %20.
	
i use this javascript :
var newURI = theURI.replace(/s/g,"%20");
	
Original Path in XML :
http://194.178.160.247/pp/XGram/PDF/Visit Cor Spierenburg3_989_989_HR.pdf
	
After :
http://194.178.160.247/pp/XGram/PDF/Vis ... 989_HR.pdf
	
	
	
instead of the percentage char it puts in a path.
	
	
I have no idea what to try next, hopefully someone has some tips for me
	
	
Thanks!
	
Robert
	
	
	
	
	
	
			I am trying to retrieve an url from a xml file and then replace the spaces with %20.
i use this javascript :
var newURI = theURI.replace(/s/g,"%20");
Original Path in XML :
http://194.178.160.247/pp/XGram/PDF/Visit Cor Spierenburg3_989_989_HR.pdf
After :
http://194.178.160.247/pp/XGram/PDF/Vis ... 989_HR.pdf
instead of the percentage char it puts in a path.
I have no idea what to try next, hopefully someone has some tips for me
Thanks!
Robert