JavaScript框架和CSS框架:JQuery,YUI,还是其他什么?

时间:2022-12-03 15:32:19

I haven't done web development for about 6 years. I'm trying to get back into it and there is a lot of new stuff out there. I've chosen to write my next project with Perl and Catalyst.

我已经做了大约6年的网络开发。我想回到它,那里有很多新的东西。我选择用Perl和Catalyst编写我的下一个项目。

I keep hearing about various JavaScript and CSS frameworks. I know very little about these frameworks so maybe this question is overly broad and open ended.

我一直听说各种JavaScript和CSS框架。我对这些框架知之甚少,所以这个问题可能过于宽泛和开放。

What are the strengths, weaknesses, and popularity of the various frameworks? Should I be using YUI, JQuery, neither, or something else?

各种框架的优点,缺点和受欢迎程度是什么?我应该使用YUI,JQuery,还是其他什么?

5 个解决方案

#1


Firstly, it's probably worth perusing Which Javascript framework (jQuery vs Dojo vs … )?.

首先,它可能值得仔细阅读哪个Javascript框架(jQuery vs Dojo vs ...)?

Secondly, there are two broad categories of Javascript framework:

其次,Javascript框架有两大类:

  1. Rich: made for creating so-called Rich Intenet Applications, they are typically aimed at creating experiences much like a desktop applications with sophisticated windowing GUIs. This includes, but aren't limited to, YUI, Dojo, ExtJS and SmartClient;

    Rich:用于创建所谓的Rich Intenet应用程序,它们通常旨在创建体验,就像具有复杂窗口GUI的桌面应用程序一样。这包括但不限于YUI,Dojo,ExtJS和SmartClient;

  2. Complementary: these are more focused on improving a traditional Website experience rather than replacing it altogether. These include jQuery, Prototype and others. Some might point out that jQuery has jQuery UI but this is a barebones widget library at best and completely incomparable to, say, YUI in terms of out-of-the-box user interface capabilities.

    补充:这些更侧重于改善传统的网站体验,而不是完全取代它。这些包括jQuery,Prototype和其他。有些人可能会指出jQuery有jQuery UI,但这是一个简单的小部件库,在开箱即用的用户界面功能方面完全无法比拟YUI。

So the first thing you should ask yourself is: what kind of application are you creating?

所以你要问自己的第一件事是:你创造了什么样的应用程序?

Personally I think you can't go wrong with YUI or jQuery, depending on your answer.

我个人认为YUI或jQuery不会出错,这取决于你的答案。

#2


Why not use both? I have on a couple projects.

为什么不同时使用?我有几个项目。

jQuery's size is small. You can use the minified version from google's open ajax libraries, and since many people already do this, there may be no download at all b/c it may very well already be in your user's cache.

jQuery的大小很小。你可以使用google的open ajax库中的缩小版本,因为很多人已经这样做了,所以b / c可能没有下载它可能已经很好地存在于你的用户缓存中。

As for YUI, they have a great configurator for getting exactly what you need. Also their documentation is very thorough and their widgets top notch in compatibility.

至于YUI,他们有一个很好的配置器,可以准确地获得你需要的东西。他们的文档也非常全面,他们的小部件兼容性也很高。

Having worked with both, jQuery's strength is it's speed and flexibility to do a lot of tasks. YUI's strength is it's top-notch, ready to use widgets. Both projects have written very solid code that will not interfere with each other. Both projects have worked hard to be compatible across all A grade browsers and careful not to trash the name space - which is better than I can say for some other frameworks.

与两者合作,jQuery的优势在于它可以快速,灵活地完成许多任务。 YUI的优势在于它是一流的,随时可用的小部件。这两个项目都编写了非常可靠的代码,不会相互干扰。这两个项目都努力在所有A级浏览器中兼容,并注意不要废弃名称空间 - 这比我对其他一些框架说的要好。

#3


I personally recommend jQuery. It is extensively developing, fast, powerful and small (comparing to YUI for example which is big). It has jQueryUI library with customizable themes for interface elements and many plugins.

我个人推荐jQuery。它正在广泛开发,快速,强大和小(例如,比YUI大)。它有jQueryUI库,可以为界面元素和许多插件定制主题。

#4


I have used JQuery, however you really should look into trying both YUI and JQuery to see how they work and whether or not they suit your needs.

我已经使用过JQuery,但你真的应该考虑尝试YUI和JQuery来看看它们是如何工作的,以及它们是否适合你的需求。

YUI: http://developer.yahoo.com/yui/

JQuery: http://jquery.com/

I personally find the JQuery documentation to be excellent. I have not really given YUI a shot.

我个人觉得JQuery文档很棒。我没有给YUI一个机会。

JQuery is the more popular of the two frameworks from what I can tell, I used JQuery at my last job and have seen heavy use of the framework.There are many plugins that have been developed for JQuery and examples can be found all over the web. Again though, I've never really played around with YUI.

从我能说的内容来看,JQuery是两个框架中比较流行的,我在上一个工作中使用了JQuery,并且看到了框架的大量使用。有很多为JQuery开发的插件,可以在网络上找到各种示例。尽管如此,我从来没有真正玩过YUI。

Here are benchmarks of MooTools, JQuery, Prototype, YUI, and Dojo on different browsers.

以下是MooTools,JQuery,Prototype,YUI和Dojo在不同浏览器上的基准测试。

Benchmarks

#5


First question you should ask yourself is: what do I need from this framework? JQuery and YUI, for example, take two totally different approaches. JQuery itself is pretty much a simple querying library that uses XPath selectors to navigate the DOM tree and apply transformations to its nodes. That being said, it also has tons of libraries (such as JQuery UI, as well as hundreds if not thousands of third party ones) that contain UI widgets, nifty animations, and other ridiculously cool things you never knew you could do so easily with Javascript. It's a functional library and doesn't really deal with objects.

你应该问自己的第一个问题是:我需要从这个框架中得到什么?例如,JQuery和YUI采用两种完全不同的方法。 JQuery本身几乎是一个简单的查询库,它使用XPath选择器来导航DOM树并将转换应用于其节点。话虽这么说,它还有大量的库(如JQuery UI,以及数百个,如果不是数以千计的第三方),它们包含UI小部件,漂亮的动画,以及其他你从未知道可以轻松实现的非常酷的东西。的JavaScript。它是一个功能库,并不真正处理对象。

YUI, on the other hand, goes the opposite direction. Primarily it's a UI library, meaning it exists to provide you with functional UI widgets (buttons, trees, panels, dialogs, etc). It also has additions and support/utility objects that can be used to do the same sort of XPath DOM tree querying as JQuery, but that's secondary. It's also pretty object-oriented.

另一方面,YUI走向相反的方向。它主要是一个UI库,这意味着它可以为您提供功能性UI小部件(按钮,树,面板,对话框等)。它还有添加和支持/实用程序对象,可用于执行与JQuery相同类型的XPath DOM树查询,但这是次要的。它也非常面向对象。

The link cletus posted is also a great place to start.

链接cletus发布也是一个很好的起点。

#1


Firstly, it's probably worth perusing Which Javascript framework (jQuery vs Dojo vs … )?.

首先,它可能值得仔细阅读哪个Javascript框架(jQuery vs Dojo vs ...)?

Secondly, there are two broad categories of Javascript framework:

其次,Javascript框架有两大类:

  1. Rich: made for creating so-called Rich Intenet Applications, they are typically aimed at creating experiences much like a desktop applications with sophisticated windowing GUIs. This includes, but aren't limited to, YUI, Dojo, ExtJS and SmartClient;

    Rich:用于创建所谓的Rich Intenet应用程序,它们通常旨在创建体验,就像具有复杂窗口GUI的桌面应用程序一样。这包括但不限于YUI,Dojo,ExtJS和SmartClient;

  2. Complementary: these are more focused on improving a traditional Website experience rather than replacing it altogether. These include jQuery, Prototype and others. Some might point out that jQuery has jQuery UI but this is a barebones widget library at best and completely incomparable to, say, YUI in terms of out-of-the-box user interface capabilities.

    补充:这些更侧重于改善传统的网站体验,而不是完全取代它。这些包括jQuery,Prototype和其他。有些人可能会指出jQuery有jQuery UI,但这是一个简单的小部件库,在开箱即用的用户界面功能方面完全无法比拟YUI。

So the first thing you should ask yourself is: what kind of application are you creating?

所以你要问自己的第一件事是:你创造了什么样的应用程序?

Personally I think you can't go wrong with YUI or jQuery, depending on your answer.

我个人认为YUI或jQuery不会出错,这取决于你的答案。

#2


Why not use both? I have on a couple projects.

为什么不同时使用?我有几个项目。

jQuery's size is small. You can use the minified version from google's open ajax libraries, and since many people already do this, there may be no download at all b/c it may very well already be in your user's cache.

jQuery的大小很小。你可以使用google的open ajax库中的缩小版本,因为很多人已经这样做了,所以b / c可能没有下载它可能已经很好地存在于你的用户缓存中。

As for YUI, they have a great configurator for getting exactly what you need. Also their documentation is very thorough and their widgets top notch in compatibility.

至于YUI,他们有一个很好的配置器,可以准确地获得你需要的东西。他们的文档也非常全面,他们的小部件兼容性也很高。

Having worked with both, jQuery's strength is it's speed and flexibility to do a lot of tasks. YUI's strength is it's top-notch, ready to use widgets. Both projects have written very solid code that will not interfere with each other. Both projects have worked hard to be compatible across all A grade browsers and careful not to trash the name space - which is better than I can say for some other frameworks.

与两者合作,jQuery的优势在于它可以快速,灵活地完成许多任务。 YUI的优势在于它是一流的,随时可用的小部件。这两个项目都编写了非常可靠的代码,不会相互干扰。这两个项目都努力在所有A级浏览器中兼容,并注意不要废弃名称空间 - 这比我对其他一些框架说的要好。

#3


I personally recommend jQuery. It is extensively developing, fast, powerful and small (comparing to YUI for example which is big). It has jQueryUI library with customizable themes for interface elements and many plugins.

我个人推荐jQuery。它正在广泛开发,快速,强大和小(例如,比YUI大)。它有jQueryUI库,可以为界面元素和许多插件定制主题。

#4


I have used JQuery, however you really should look into trying both YUI and JQuery to see how they work and whether or not they suit your needs.

我已经使用过JQuery,但你真的应该考虑尝试YUI和JQuery来看看它们是如何工作的,以及它们是否适合你的需求。

YUI: http://developer.yahoo.com/yui/

JQuery: http://jquery.com/

I personally find the JQuery documentation to be excellent. I have not really given YUI a shot.

我个人觉得JQuery文档很棒。我没有给YUI一个机会。

JQuery is the more popular of the two frameworks from what I can tell, I used JQuery at my last job and have seen heavy use of the framework.There are many plugins that have been developed for JQuery and examples can be found all over the web. Again though, I've never really played around with YUI.

从我能说的内容来看,JQuery是两个框架中比较流行的,我在上一个工作中使用了JQuery,并且看到了框架的大量使用。有很多为JQuery开发的插件,可以在网络上找到各种示例。尽管如此,我从来没有真正玩过YUI。

Here are benchmarks of MooTools, JQuery, Prototype, YUI, and Dojo on different browsers.

以下是MooTools,JQuery,Prototype,YUI和Dojo在不同浏览器上的基准测试。

Benchmarks

#5


First question you should ask yourself is: what do I need from this framework? JQuery and YUI, for example, take two totally different approaches. JQuery itself is pretty much a simple querying library that uses XPath selectors to navigate the DOM tree and apply transformations to its nodes. That being said, it also has tons of libraries (such as JQuery UI, as well as hundreds if not thousands of third party ones) that contain UI widgets, nifty animations, and other ridiculously cool things you never knew you could do so easily with Javascript. It's a functional library and doesn't really deal with objects.

你应该问自己的第一个问题是:我需要从这个框架中得到什么?例如,JQuery和YUI采用两种完全不同的方法。 JQuery本身几乎是一个简单的查询库,它使用XPath选择器来导航DOM树并将转换应用于其节点。话虽这么说,它还有大量的库(如JQuery UI,以及数百个,如果不是数以千计的第三方),它们包含UI小部件,漂亮的动画,以及其他你从未知道可以轻松实现的非常酷的东西。的JavaScript。它是一个功能库,并不真正处理对象。

YUI, on the other hand, goes the opposite direction. Primarily it's a UI library, meaning it exists to provide you with functional UI widgets (buttons, trees, panels, dialogs, etc). It also has additions and support/utility objects that can be used to do the same sort of XPath DOM tree querying as JQuery, but that's secondary. It's also pretty object-oriented.

另一方面,YUI走向相反的方向。它主要是一个UI库,这意味着它可以为您提供功能性UI小部件(按钮,树,面板,对话框等)。它还有添加和支持/实用程序对象,可用于执行与JQuery相同类型的XPath DOM树查询,但这是次要的。它也非常面向对象。

The link cletus posted is also a great place to start.

链接cletus发布也是一个很好的起点。