Javascript does not allow you to have multiple lines inside your lines. You either need to convert each line to \ n, for example:
$("div#notification_box").html('line1\nline2');
or precedes the end of each line as follows: \
$("div#notification_box").html('line1\
line2');
The first method seems to be more widely used, although the second method looks better in my opinion.
In addition, a good and easy way to check javascript errors is to run it through a javascript delimiter, for example http://www.javascriptlint.com/online_lint.php or http://www.jslint.com/ (although jslint does not report an error like this as good as javascriptline).
source
share