简体   繁体   English

express-ejs-layouts 和 DHTML 有什么区别?

[英]What is the difference between express-ejs-layouts and DHTML?

Google search told me that DHTML means generating HTML content dynamically.谷歌搜索告诉我,DHTML 意味着动态生成 HTML 内容。 The examples were using Javascript for the dynamic content.这些示例使用 Javascript 作为动态内容。

EJS says the same about itself. EJS 对自己也是这么说的。 E stands for Embedded but that's what DHTML does already - embedds Javascript? E 代表 Embedded,但 DHTML 已经这样做了 - 嵌入 Javascript?

  • Does EJS have some extra features which DHTML doesn't? EJS 是否有一些 DHTML 没有的额外功能?
  • Is EJS a framework on the top of DHTML like Qt is for C++? EJS 是否是 DHTML 之上的框架,例如 Qt 适用于 C++?

What is the difference between express-ejs-layouts and DHTML? express-ejs-layouts 和 DHTML 有什么区别?

express-ejs-layouts is an extension of ejs that allows server side layouts with ejs templates. express-ejs-layoutsejs的扩展,它允许使用ejs模板进行服务器端布局。 DHTML is a general term for extending HTML with client side JS (with or without templates). DHTML 是使用客户端 JS(带或不带模板)扩展 HTML 的通用术语。 Both approaches are dynamic.这两种方法都是动态的。 Some modern frameworks like React support server side rendering, which essentially implements both client and server side templating with the same code.一些现代框架,如 React 支持服务器端渲染,它本质上使用相同的代码实现客户端和服务器端模板。

E stands for Embedded but that's what DHTML does already - embedds Javascript? E 代表 Embedded,但 DHTML 已经这样做了 - 嵌入 Javascript?

ejs is just the name chosen for that specific technology, and DHTML doesn't necessarily have to have JS in HTML files. ejs只是为该特定技术选择的名称,DHTML 不一定必须在 HTML 文件中包含 JS。

Does EJS have some extra features which DHTML doesn't? EJS 是否有一些 DHTML 没有的额外功能?

EJS templates can run on the server and generate head tags, which isn't always possible for DHTML templates. EJS 模板可以在服务器上运行并生成 head 标记,这对于 DHTML 模板并不总是可行的。

Is EJS a framework on the top of DHTML like Qt is for C++? EJS 是否是 DHTML 之上的框架,例如 Qt 适用于 C++?

No. It would be more accurate to describe EJS as a templating technology, and DHTML as a frontend architecture.不,将 EJS 描述为模板技术,将 DHTML 描述为前端架构会更准确。 EJS could be part of a DHTML separate, or separate (on the server only). EJS 可以是单独的 DHTML 的一部分,也可以是单独的(仅在服务器上)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM