JavaScript menggantikan spasi dengan nbsp
str = str.replace(/\s/g, " ");
Friendly Hawk
str = str.replace(/\s/g, " ");