Have problem with multi-line string in javascript
This works:
alert('foo\
开发者_开发百科 bar'
)
But this is causing syntax error:
t='test';
alert('<tr><td><b>' + t + '</b></td>\
<td></td><td>')
error is:
SyntaxError: unterminated string literal
They two should be the same thing, why the first one works, while the second fails?
You have a trailing space after your backslash in the second example.
精彩评论