JS reemplaza el espacio con más

// replaces space with '+'
str = str.replace(/ /g, "+");
// or
str = str.split(' ').join('+');
VasteMonde