3 ms·
The main reason to write it into the HTML was to be more maintainable, by putting the presentation in the HTML presentation layer. Most libraries, such as rivet
by mattinsler 13y ago
The main reason to write it into the HTML was to be more maintainable, by putting the presentation in the HTML presentation layer. Most libraries, such as rivets do very similar things for very similar reasons. When I know there's a data formatting issue in 1 element in the HTML, I can just fix that in the HTML. I don't need to go into the javascript and find which jquery snippet changes that HTML element and does the formatting.
- calebio 13y agoPersonally I would hate large amounts of logic in my attributes like that. I much think that properly formatted and structured JavaScript solves this problem much better. Especially when the same logic applies to two elements and you can create a function for it.
- mattinsler 13y agoRivets actually does a great job allowing you to create functions for similar formatting, which allows you to have very very short attributes, which in turn ends up being multiples of lines less than the equivalent javascript.