Node.js中的服务器和客户端渲染 [英] Server and client side rendering in node.js

查看:159
本文介绍了Node.js中的服务器和客户端渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不了解客户端渲染的概念。我一直将服务器端渲染与PHP / Ruby结合使用,我看不出有可能进行客户端渲染。

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.

谁来做?浏览器?

如果有人可以给出解释或链接来说明这一点,我将不胜感激。

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

推荐答案

没有讽刺意味,它是客户端编译/操作,服务器端编译/操作或两者结合的区别。

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.

但是对什么进行编译/操作?

通常,我们谈论的是HTML,CSS,JavaScript资产,也许还有从数据库返回的一些数据,这些数据根据请求被编译/处理为可以作为应用程序呈现在浏览器上的东西。

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.

您可以在客户端使用纯旧的javascript,jquery,boneline,angular,ember等方式进行此操作。您可以在服务器端使用普通的进行此操作-old-node或 Sails.js 之类的框架之一。

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.

这篇关于Node.js中的服务器和客户端渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆