how to inject line feeds into dynamically created html (javascript)
I'm creating HTML from javascript c开发者_Go百科ode.
What character(s)/escape codes should I add to the long html to cut the html into smaller lines (in the html source level, not in the rendered html result)?
You can use \n
for unix/linux or \n\r
for Windows.
Example:
var someString = 'Hello ' + 'Wordl\n';
someString += 'Hello ' + 'Wordl Again\n';
精彩评论