Avatar of codequest
codequest
 asked on

How much formatting to perform on the client in Javascript

I'm rewriting a 2005-era ASP.NET app that currently does most of the display formatting on the server by building HTML strings which are then sent via xmlhttprequest to the client.  

I can see how I might use MVC/Razor/JQuery/JSON/AJAX to just send the data content to the client, and let the client do the DOM display object construction, even if it requires a good bit of business logic.

> At the moment I'm not overly concerned about exposing the IP of the display logic in the client javascript.
> For this application a "large" completely formatted div in the app might run 500K of HTML of which no more than 50K of data would be data (average would probably be more like 250K and 25K).   There could be three such divs being displayed (overlapping) at any one time (along with a few much smaller ones, essentially popups).
> I'm hoping to run the app on PCs, tablet and phones.

What I'm hoping to find from EExperts is:
==> input/ideas/views on how to decide whether to put the display logic in the client, or keep it back in the server.

Any help with this would be appreciated.

Thanks.
JavaScriptASP.NETWeb Applications

Avatar of undefined
Last Comment
codequest

8/22/2022 - Mon
SOLUTION
Chinmay Patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Gary Davis

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
codequest

ASKER
Thanks for the input.  Those are clear recommendations for separation of concerns and a pointer to a tool that indicates client side formatting is best practice.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy