Node.js 和浏览器(包括 IE6)的标准继承系统?

发布于 2024-09-28 02:28:24 字数 568 浏览 2 评论 0原文

我正在寻找一个可以在 Node.js 和浏览器中工作的标准继承系统。

sys.inherits 在旧浏览器中不起作用(Object.create)。

所有 js 库(jquery、extjs、dojo...)都有相似但不同的继承系统。 (不知道哪一个对node.js有好处)

想要使用一个简单的并且可能成为未来“标准”的(至少在基于node.js的系统中)。

有什么想法吗?您使用的是哪一款?

还发现了一些有趣的项目:

http://howtonode.org/prototropic-inheritance (不适合 IE)

http://jsclass.jcoglan.com/modules.html (太大,太红宝石?)

顺便说一句,我在前端使用 require.js 。

谢谢

I am looking for a Standard Inheritance System that can work in both node.js and browsers.

sys.inherits doesn't work in old browsers (Object.create).

All js libraries (jquery, extjs, dojo...) have similar but diff inherit systems. (Don't know which one is good for node.js)

Want to use one which is simple and may become the "standard" in the future (at least in node.js based system).

Any idea? Which one are you using?

Also found some interesting projects:

http://howtonode.org/prototypical-inheritance (Not good for IE)

http://jsclass.jcoglan.com/modules.html (Too large, too ruby?)

By the way, I am using require.js in frontend.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Hello爱情风 2024-10-05 02:28:24

使用node.js的sys.inherits服务器端,使用您的框架在前端使用的任何内容。

保持简单。

Use node.js' sys.inherits server side, use whatever your framework uses in the front end.

Keep it simple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文