views:

14

answers:

1

I'm creating HTML from javascript code.

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)?

A: 

You can use \n for unix/linux or \n\r for Windows.

Example:

var someString = 'Hello ' + 'Wordl\n';
someString += 'Hello ' + 'Wordl Again\n';
Sarfraz
strangely when I add \n between two images who are supposed to be positioned one next to the other without space it adds a space.for example:<a href='' style='border:none; text-decoration:none;' ><img style='border:none; margin:0 0 0 0; padding;0 0 0 0;' src='image'/></a>Positions the images without gaps.But <a href='' style='border:none; text-decoration:none;' >\n<img style='border:none; margin:0 0 0 0; padding;0 0 0 0;' src='image'/>\n</a> Adds a gap between the images.Is it possible to add line break in the source code without adding a gap in the rendered html? (tested on firefox).
Nir