js replace space with %20 code example
Example 1: js replace space
// replaces space with '_'
str = str.replace(/ /g, "_");
// or
str = str.split(' ').join('_');
Example 2: javascript string spaces replace with %20
string.replace()
Example 3: javascript how to deal with %20 in string
decodeURI(str)