Currently I'm using an HTML template, and using selectors to fill in those data like this:
$("#post-title > a").text(data.title);
$.each(doc.comments, function(index, comment) {
// some raw HTML tangled up in JavaScript...
});
It's really repetitive and rely too much on tags' ID attribute.
Is there a way to separate HTML tags from JavaScript? I've heard jQuery Templates, but they're deprecated aren't they?
$("#post-title > a").text(data.title);
$.each(doc.comments, function(index, comment) {
// some raw HTML tangled up in JavaScript...
});
It's really repetitive and rely too much on tags' ID attribute.
Is there a way to separate HTML tags from JavaScript? I've heard jQuery Templates, but they're deprecated aren't they?