Which browsers support multi-line strings?
"foo \
bar"
As usual, my main suspect for not supporting it is IE. Which IE version is the first that supports it?
Which browsers support multi-line strings?
"foo \
bar"
As usual, my main suspect for not supporting it is IE. Which IE version is the first that supports it?
All current versions of the major browsers accept multi-line strings.
Note: this technique is apparently not in compliance with browser standards; however, it works out fine when tested across all current versions of the major browsers.
Multiline String literals are disallowed by the Google Style Guide.
The accent grave (back-quote, back tick) character works like a quotation mark to define multiline strings in Javascript in Firefox and Google chrome, but not in Internet Explorer 11. These strings are called Template Literals and are part of the ES6 specification. I'm guessing that the generated newline sequence is what your editor generates, not what is expected on the computer that is interpreting the Javascript code.
Example:
var str=`This string
has three
lines.`;