jquery 是否取代了 dojo 的需要?

发布于 2024-10-09 03:35:21 字数 122 浏览 0 评论 0原文

我正在使用 PHP Zend 框架启动一个新项目。

现在jquery已经相当成熟了,是不是不再需要dojo了?

我并不是说这是一个意见问题。一个有效的答案可能是它们仍然可行。

谢谢!

I am starting a new project using the PHP Zend framework.

Now that jquery is fairly mature, is dojo no longer needed?

I do not mean for this to be an opinion question. A valid answer could be that they both still are viable.

Thanks!

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

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

发布评论

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

评论(2

情绪操控生活 2024-10-16 03:35:21

取决于您的需求。如果您需要的只是 XHR 和 DOM 操作,那么您可以选择任何知名的库。但如果您正在寻找除此之外的东西,Dojo 可以为您提供。 jQuery...确实不是(至少在没有四处寻找插件的情况下不是这样,然后你就进入了 YMMV 领域)。

每当有人问这样的问题时,我总是向他们指出 Rebecca Murphey 的优秀博客文章,指出 jQuery 没有真正考虑哪些事情:

http://rmurphey.com/blog/2010/08/09/on-jquery-large-applications/

Dojo 为您提供的一些示例jQuery 没有 OOTB:

  • 模块化和依赖管理系统
    • RequireJS 在 jQuery 用户中很受欢迎;有趣的是,它现在是 Dojo 基金会项目,其模块格式也可以在 Dojo 1.6 中使用。
  • 继承框架 (dojo.declare)
  • 具有 WAI-ARIA 支持的完全可换肤/可扩展小部件 (dijit,更多信息请参见 dojox)
  • 一致的数据 API (由更多数据密集型小部件(例如 Select、ComboBox、FilteringSelect 和 dojox.grid)使用)
  • Pub/sub 框架用于跨应用程序进行通信,而无需直接将不相关的组件绑定在一起
  • 哈希支持(dojo.hash 自 1.4 起)
  • 构建脚本,用于滚动您自己的 Dojo 自定义构建,其中包含合并到一个脚本中的所有应用程序依赖项的层。

Depends on your needs. If all you need is XHR and DOM manipulation, you can probably pick any well-known library out there. But if you're looking for stuff beyond that, Dojo gives it to you. jQuery...doesn't, really (at least not without looking around for plugins, and then you're getting into YMMV territory).

Whenever anyone asks something like this I always point them to Rebecca Murphey's excellent blog post pointing out what kinds of things jQuery doesn't really consider:

http://rmurphey.com/blog/2010/08/09/on-jquery-large-applications/

Some examples of things Dojo gives you that jQuery doesn't OOTB:

  • Modularization and dependency management system
    • RequireJS is popular for this among jQuery users; interestingly, it's now a Dojo Foundation project, and its module format will also be usable in Dojo 1.6.
  • Inheritance framework (dojo.declare)
  • Fully skinnable/extensible widgets with WAI-ARIA support (dijit, with more in dojox)
  • Consistent data APIs (used by more data-intensive widgets such as Select, ComboBox, FilteringSelect, and dojox.grid)
  • Pub/sub framework for communicating across an application without necessarily directly binding together unrelated components
  • Hash support (dojo.hash since 1.4)
  • Build script for rolling your own custom build of Dojo with layers containing all your app's dependencies consolidated into one script.
无边思念无边月 2024-10-16 03:35:21

您不一定可以进行一对一的比较。 Dojo 确实是一个不同的野兽......它的架构更加高度化,因此使用起来并不简单,但是通过这种简单性的权衡,您将获得更强大且可编程扩展的 JS框架。

就我个人而言,我并不是 Dojo 的忠实粉丝,因为我通常不开发 JS 应用程序,例如 GMail 或其他应用程序。我认为这是 Dojo 真正发挥作用的背景。但如果您需要做的只是添加一些 ui 小部件并操作 DOM,我认为 jquery 是更好的选择。

直接回答你的问题:不,jQuery 确实使 Dojo 变得更少或更多需要。在我看来,jQuery 1.2.6Dojo 一样成熟,自从我开始使用 ZF 以来,项目的成熟度水平从未成为考虑因素em> - 始终与项目的需求以及每个项目的实现方式/功能有关。

You can't necessarily do a one to one comparison. Dojo is a different beast really... It is highly more architected and thus isn't as simple to use, but with this tradeoff for simplicity you get a much more robust and programmatically extensible JS framework.

Personally I'm not a big fan of Dojo since I don't typically develop JS applications like GMail or what have. I think this is the context where Dojo really shines. But if all you need to do is add some ui widgets and manipulate the DOM I think jquery is the better choice.

To answer your question directly: No, jQuery does make Dojo any less or more needed. And in my eyes jQuery 1.2.6 was as mature as Dojo and this the maturity level of the projects has never been a consideration since I started using ZF - it's always been about the needs of the project and how/what features are implemented in each.

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