[javascript] Replace all spaces in a string with '+'