So I’ve been playing around with the replace function (method?) in js.
$get('msgBar').replace(/+/g,' ');
Let’s say the content of $get(‘msgBar’) is “Welcome+back+now”.
replace('+',' ') would only replace the first +, and not the second.
replace(/+/g,' ') crashes
replace(/"+"/g,' ') and replace(/\+/g,' ') are both the same as the first
I’m sure the solution is easy… 🙂
You must quote +:
‘+’ is a meta character, like ‘*’. It means “one more repetitions”. It you literally want ‘+’ , then you have to quote it with the backslash.