Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery new line \n [duplicate]

Possible Duplicate:
What's the cleanest way to write a multiline string in JavaScript?

How does one go onto a new line in writing jQuery code not the actual output of the code, for example:

$('#foo').append('<div id="bla"> '+\n+'
                  </div>');

Something like that.

like image 405
daryl Avatar asked Jun 05 '11 23:06

daryl


1 Answers

$('#foo').append('<div id="bla"> \
                 </div>');

The slash (\) escapes the newline, allowing the string to span multiple lines

like image 76
Greg Flynn Avatar answered Oct 20 '22 20:10

Greg Flynn