javascript how to deal with %20 in string

JavaScript
decodeURI(str)
Source

Also in JavaScript: