jQuery 中缺少的功能

发布于 2024-07-29 07:37:05 字数 243 浏览 3 评论 0原文

jQuery 是当今非常流行的 JavaScript 框架。 例如,您可以根据该网站上 jQuery 标签的数量来判断。

我没有使用过任何其他 JS 框架,我想听听您对您认为该库缺少的一些功能的看法。

  • 你会在项目中改变什么?
  • 你会添加什么?
  • 有没有您认为没有价值的功能?
  • 您希望在 jQuery 中看到其他 JS 框架中著名的哪些功能?

jQuery is a very popular JavaScript framework nowadays. You can tell that based on number of jQuery tags on this site for example.

I haven't used any other JS frameworks and I would like to get your opinion on some of features you can think of that the library is missing.

  • What would you change in the project?
  • What would you add?
  • Are there any features that you think are worthless?
  • What features famous in other JS frameworks you would like to see in jQuery?

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

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

发布评论

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

评论(5

野侃 2024-08-05 07:37:05

我最常用的 JavaScript 库是 jQueryYUIExtJS(核心)。

我最喜欢的仍然是 jQuery,但我仍然希望其中有 ExtJS Core 的一些功能。

我第一次使用 ExtJS 时就爱上了它的继承系统,我个人认为它非常巧妙,我很想在 jQuery 中拥有它。 不过,我最近发现了 John Resig<​​/strong> 的项目之一(jQuery 的创建者)“简单 JavaScript 继承”(你可以在这里找到它),它看起来非常强大而且很小。

我希望在 jQuery 中看到的另一个功能是更加智能的扩展系统。

我不会在 jQuery 中改变其他事情,我认为它是 JavaScript 库的最完美选择,适用于非常广泛的应用程序。

对于小部件,我更喜欢 ExtJS 而不是 jQuery UI

The JavaScript libraries I used the most are jQuery, YUI and ExtJS (Core).

My favorite though remains jQuery, but I still would like some of ExtJS Core's functionality in it.

First time I worked with ExtJS I fell in love with it's inheritance system, I personally think it's very ingenious and I would love to have it in jQuery. Still I recently found one of John Resig's projects (the creator of jQuery) 'Simple JavaScript Inheritance' (you can find it here) and it seems to be very powerful and small.

Another feature I would like to see in jQuery would be a much more intelligent extension system.

Other things I wouldn't change in jQuery, I think it's the most perfect choice for a JavaScript library, for a very broad range of applications.

For widgets I prefer ExtJS than jQuery UI

以为你会在 2024-08-05 07:37:05

不确定其他人是否想要它,但我不介意使用 .revert() 函数来“撤消”自页面加载以来对项目或选择器所做的任何更改。

例如。 您可能会在浏览时更改 div 的颜色、大小和一些属性。 在选择器上调用 .revert() 将撤消这些更改。

Not sure whether anybody else would want it, but I wouldn't mind a .revert() function that "undoes" any changes you've made to an item or selector since the page was loaded.

eg. You might change the colour, size, and a couple of attributes of a div while you go through. Calling .revert() on the selector would undo these changes.

烂柯人 2024-08-05 07:37:05

UI 部门缺少 jQuery。 有数千个插件,但它们都使用不同的皮肤和样式。 他们应该专注于他们的官方 UI 库,并尝试使其像 ExtJS 一样丰富和一致。

jQuery is lacking in UI department. There are thousands of plugins but all of them use different skins and styling. They should concentrate on their official UI library and try to make it as rich and consistent as ExtJS.

双手揣兜 2024-08-05 07:37:05

我很想看到 Prototype 的柯里化功能 在 jQuery 中原生。 自己动手并不难,但本地总是更好。

I would love to see Prototype's currying features native in jQuery. It's not difficult to roll your own, but native is always nicer.

虐人心 2024-08-05 07:37:05

jQuery Live 的变化

我希望看到 jQuery live 能够处理所有类型的事件。 目前,要绑定一些事件(我认为其中最常见的是 changesubmit),您仍然需要使用像 实时查询

$.postJSON()

我认为添加 $.postJSON() 方法是个好主意。 目前我们有一个类似于$.get()的.getJSON(),它只是将返回的数据类型设置为json。 但是,当涉及到 POST 通信时,您需要为每次调用自行填写此额外字段。

当然,这可以很容易地解决,但我希望将其视为核心库的一部分。

$.postJSON = function(url, data, callback) {
    $.post(url, data, callback, 'json');
};

jQuery Live changes

I would like to see jQuery live to work with all types of events. Currently to bind some of the events (change and submit of those are most frequent in my opinion) you still need to use a plugin like Live Query.

$.postJSON()

I think it would be a good idea to add a $.postJSON() method. Currently we have a .getJSON() that is similar to $.get() it just sets the type of data returned to json. However when it comes to POST communication you need to fill this extra field yourself for each call.

Of course this can be easily fixed but I would like to see that as a part of core library.

$.postJSON = function(url, data, callback) {
    $.post(url, data, callback, 'json');
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文