Re:Poll: Where do you assemble your on-the-fly HTML?
by nostrademons on Sunday March 02, 2008 @11:02AM
(#127403)
Both. App is divided into components - the editor is one component, which is written as a JavaScript application that's kicked off with a single JS function call and handles all the HTML for itself, dynamically. The rest of the website is generated on the server and uses JS only for decoration.
I'd worry more about ease of programming than machine constraints. Webapps are rarely CPU-bound, so the overhead of template instantiation isn't likely to make much difference. You definitely want to keep related functionality together - in earlier drafts, I'd generated the HTML for the editor on the server and manipulated it with JQuery. This was a disaster - I could never remember whether functionality was in the HTML template or in the JavaScript, and I had to duplicate some logic in both places.
I'd worry more about ease of programming than machine constraints. Webapps are rarely CPU-bound, so the overhead of template instantiation isn't likely to make much difference. You definitely want to keep related functionality together - in earlier drafts, I'd generated the HTML for the editor on the server and manipulated it with JQuery. This was a disaster - I could never remember whether functionality was in the HTML template or in the JavaScript, and I had to duplicate some logic in both places.