Server and client side rendering in node.js

北城余情 提交于 2020-02-08 08:50:49

问题


I don't understand the concept of client-side rendering. I have always used server-side rendering with PHP/Ruby, I don't see how it is possible to have client side rendering.

Who does the work? The browser?

If someone could give explanations or links that explains that, I would be grateful.


回答1:


Without sounding sarcastic, it is a distinction between client-side compilation/manipulation, server-side compilation/manipulation, or a combination of both. While the browser is the thing that actually does the rendering.

But compilation/manipulation of what?

In general we're talking about HTML, CSS, javascript assets and maybe some data returned from a db that upon request gets compiled/manipulated into something that can be rendered on the browser as our application.

You can do this on the client-side using plain-old-javascript, jquery, backbone, angular, ember, etc.. You can do this on the server-side using plain-old-node or one of the frameworks like Sails.js.



来源:https://stackoverflow.com/questions/24813073/server-and-client-side-rendering-in-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!