without using any templating engine I often write something like this
success(data) {
var html = '';
if (data) {
$.each(data.result, function() {
html += '<button type="button" class="btn btn-navbar" data toggle="collapse" data-target=".nav-collapse">'
html += '<span class="icon-bar"></span>'
html += '<span class="icon-bar"></span>'
html += '<span class="icon-bar"></span>'
html += '</button>'
});
$('something').append(html);
}
}
if the html I want is massive it's hard to read, any way to keep the indentation in my case above?