简体   繁体   English

Ext JS是jQuery的超集吗?

[英]Is Ext JS a superset of jQuery?

So jQuery handles DOM manipulation, event handling, and special effects. 所以jQuery处理DOM操作,事件处理和特殊效果。 Ext JS also does that, plus has a lot of built-in UI components. Ext JS也是这样做的,还有很多内置的UI组件。

Here's the question. 这是问题所在。 Is there anything substantial that jQuery has that Ext JS doesn't? 有没有什么实质的jQuery有Ext JS没有?

Here's the context. 这是上下文。 I've been wondering what reason people would have of using both Ext JS and jQuery. 我一直想知道人们使用Ext JS和jQuery的原因是什么。 Some guesses: 一些猜测:

  • They feel more comfortable with jQuery, but need the extra capabilities of Ext JS 他们对jQuery感觉更舒服,但需要Ext JS的额外功能
  • They have a site already in production with jQuery, need to add Ext JS, and don't want to rewrite what's already there 他们有一个已经使用jQuery生产的网站,需要添加Ext JS,并且不想重写已有的内容
  • There's something that jQuery has that Ext JS doesn't 有一些jQuery具有Ext JS没有的东西

To put it really simple: ExtJS is to Ext Core what jQuery UI is to jQuery . 说得非常简单: ExtJSExtcore的 jQuery UIjQuery的

ExtJS and jQuery UI are both component libraries ExtJS和jQuery UI都是组件库
Ext Core and jQuery are both javascript frameworks aimed at dom manipulation and Ajax. Ext Core和jQuery都是针对dom操作和Ajax的javascript框架

Basically, ExtJS provides a completely different set of features that jQuery. 基本上,ExtJS提供了与jQuery完全不同的一组功能。 Like you said, jQuery is designed and optimized for DOM manipulation (selectors, attributes, traversing, effects etc), whereas ExtJS' primary purpose is to provide a rich component library for user interfaces. 就像你说的,jQuery是为DOM操作(选择器,属性,遍历,效果等)设计和优化的,而ExtJS的主要目的是为用户界面提供丰富的组件库。

If you're working with the DOM and you aren't creating any kind of user interface then stick with jQuery, but if you're creating a rich web app then ExtJS is for you. 如果您正在使用DOM并且您没有创建任何类型的用户界面,那么坚持使用jQuery,但如果您正在创建一个富Web应用程序,那么ExtJS适合您。

Whilst ExtJS provides some basic DOM manipulation in it's Ext.Element class, it is nothing on jQuery and many people use the two together for this reason. 虽然ExtJS在它的Ext.Element类中提供了一些基本的DOM操作,但它在jQuery上并没有什么,因此很多人将这两者结合使用。

EXT JS has a much better user interface library. EXT JS有一个更好的用户界面库。 Generally, people like the ease of writing javascript code with JQuery, but are wowed by the polished user interface of the EXTJS widgets. 一般来说,人们喜欢用JQuery编写javascript代码的简易性,但是EXTJS小部件的精美用户界面让人赞叹不已。

So, to answer your question - no; 那么,回答你的问题 - 不; both are standalone Javascript frameworks / libraries. 两者都是独立的Javascript框架/库。 They both do all of the things you mentioned. 他们都做你提到的所有事情。 It's just that EXT JS does the UI stuff better, and JQuery does the DOM manipulation stuff better. 这只是EXT JS更好地完成了UI的工作,而JQuery更好地完成了DOM操作。

也许是因为jQuery确实有很多插件可用,而extjs的用户提供的插件很少。所以一些开发人员可能会受益于jQuery + Extjs的实现。

I think the Ext.DomQuery class can do probably everything the jQuery DOM selectors can do... but I have not really looked into the differences. 我认为Ext.DomQuery类可以完成jQuery DOM选择器可以做的所有事情......但我还没有真正研究过这些差异。 Also, DomQuery is part of Ext Core, which has the same license as jQuery. 此外,DomQuery是Ext Core的一部分,它与jQuery具有相同的许可。

http://dev.sencha.com/deploy/dev/docs/?class=Ext.DomQuery http://dev.sencha.com/deploy/dev/docs/?class=Ext.DomQuery

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

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