Tuesday, December 30, 2014

JavaScript multiline string

To use multiline string in JavaScript,

you can use '\' as follows:

$.templates("personTemplate",
    ' \
    <tr> \
        <td>{{>name}}</td> \
        <td>{{>age}}</td> \
    </tr> \
    '
);

Reference:
http://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript

No comments:

Post a Comment