Is it better to build HTML Code string on the server or on the client side?

Posted by Ionut on Programmers See other posts from Programmers or by Ionut
Published on 2012-03-19T10:24:26Z Indexed on 2012/03/19 18:14 UTC
Read the original article Hit count: 323

Filed under:

The result of the following process should be a html form. This form's structure varies from one to user. For example there might be a different number of rows or there may be the need for rowspan and colspan.

When the user chooses to see this table an ajax call is made to the server where the structure of the table is decided from the database. Then I have to create the html code for the table structure which will be inserted in the DOM via JavaScript.

The following problem comes to my mind: Where should I build the HTML code which will be inserted in the DOM? On the server side or should I send some parameters in the ajax call method and process the structure there?

Therefore the main question involves good practice when it comes to decide between Server side processing or client side processing.

Thank you!

© Programmers or respective owner

Related posts about programming-practices