Not specifically a SharePoint issue but i'm using it with the confines of SharePoint 2013 REST API. The following code is used to get URL parameters.
The page with this code is accessed from a link on another page. Within that link i'm passing in the list item ID and also the list item Title. When the page with the above code loads the Title in the URL has %20 in place of all spaces. I've read up on this and found i need to use decodeURI or decodeURIComponent. I've tried to do this in a number of places and alerted the result in the browser but i can't seem to get rid of the %20 from the title within the URL so its obvious i'm not doing it in the right place.
this is my result....
http://PAGE URL HERE/NewsArchive.aspx?Story=New%20site%20launched&ID=17
Where should i use the decodeURI? Is it on the page with the link that contains the list item title and ID or is it somewhere within the above code?
Any help appreciated.