3 ms·
Because you have to hit the server initially. While you could totally serve some JS, JSON data and a small HTML wrapper to kickstart the client-side code, just
by _dan 16y ago
Because you have to hit the server initially. While you could totally serve some JS, JSON data and a small HTML wrapper to kickstart the client-side code, just generating the page is a lot simpler and typically more efficient.
Then you have all the problems of a purely client-side application (dealing with deep-linking, bookmarks, back buttons, users with exotic browsers, search engines, etc). That stuff can all be dealt with, but all dramatically increases the complexity. Your "Hello World" quickly becomes complex and unwieldy.
I personally think the right way is probably a templating engine that can work either client- or server-side so you can generate whatever you need wherever you are.