Express js 中是否有 dom 事件侦听器的替代方案
由于express js不允许Dom相关命令,所以我无法跟踪按钮,即单击按钮的时间。不仅仅是点击按钮,任何类型的跟踪都是不可能的。任何人都可以建议一个替代方案吗?如果 Express 中没有任何内容,一个新的图书馆或任何可以与 Express 一起使用并帮助我解决这个问题的东西。谢谢
since express js doesn't allow Dom related commands, so I am not able to keep tracks of buttons i.e. when they are clicked. Not just button clicking but any kind of tracking is not possible. Can anyone please suggest a alternate for this. If there is nothing in express, a new library or anything that can work with express and help me with this. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在这里混淆了事情。 Express.js 在后端运行。后端没有 DOM,因此没有 API 来操作 DOM。
您可以使用模板引擎(快速支持,例如 handlebars 和 EJS)并链接您返回的 HTML 中的 JavaScript 文件。或者您使用 React、Vue、Svelte、Angular 等前端框架来执行此操作。
You are confusing things here. Express.js runs on the backend. There is no DOM on the backend, hence there is no API to manipulate the DOM.
You can use template engines (express supports e.g. handlebars and EJS) and link JavaScript files within the HTML that you return. Or you use a frontend framework like React, Vue, Svelte, Angular etc. in order to do this.