I am new to web development and facing difficulty to choose an approach from the below:
In my current project we have to build a application which will be public facing and targeted browsers "Chrome", "Safari" & "FF".
main job is to, for example we have a live feed thats going to be displayed in user screen.
The approaches we thought of is: Approach 1- By using MVC framework for example JSF/Spring MVC, controller will get the data from db, and it will update the HTML.
Approach 2- Server will give the Json/Gson response and from that response building the html using Javascript (using Jquery's .html() method)
By following the approach 1, I will have clean html, but during update the DOM tree via ajax for every new content it will be appending to the generated HTML.
By follwoing approach 2, I am finding all task like templating for clean code, feed update and html events such as click, mouse enter etc is eaiser.
Went through the following URL'S: https://softwareengineering.stackexchange.com/questions/142002/when-should-javascript-generate-html http://developer.nokia.com/Community/Wiki/JavaScript_Performance_Best_Practices Simple html vs Javascript generated html? https://developers.google.com/speed/articles/javascript-dom
Still I am trying to understand what should be approach, which one will be faster? whats Pro and Con of each approach?
Thanks for your help to make me understand