最有用的jQuery本机API函数 [英] Most useful jQuery native API functions

查看:73
本文介绍了最有用的jQuery本机API函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最常用的5-10个jQuery本机API函数是什么? (请不要建议jQuery()函数本身,因为毫无疑问这是最常用的一个)如果有可能请提供他们所涵盖的风格。

What are the top 5-10 most often used jQuery native API functions? (please do not suggest jQuery() function itself as there is no doubt this is the most often used one) If it is possible please also provide scenarious they cover.

提出这个问题的原因是我尝试为 Ample SDK JavaScript GUI Framework创建类似jQuery的API (由于存在所有功能实现,主要是重新指向功能的问题)。这个框架已经有了标准的API(DOM Level 2-3),但是从我听到的情况来看,许多开发人员并不熟悉DOM API,其他人不喜欢这些API,但他们喜欢简洁的jQuery API(兼具方便的功能和流畅性)编程实践)

The reason to ask this question is my attempt to create a jQuery-like API to the Ample SDK JavaScript GUI Framework (there it is mainly matter of re-pointing functions, thanks to all functionality implementation present). This framework has already standard APIs (DOM Level 2-3), however from what I hear, many developers do not know well DOM APIs, others don't like those APIs, but they like concise API of jQuery (both convinient functions and fluid programming practice)

推荐答案

我发现我使用的是.val,.attr,.addClass,.removeClass,.hasClass ,.悬停,.click最多。

I find I'm using .val, .attr, .addClass, .removeClass, .hasClass, .hover, .click the most.

.val / .attr / .hasclass我用来识别预设值。我通常在元素上使用自定义属性,并使用attr返回它们很棒。喜欢存储,如果我已经预先加载了元素的内容。其余的很直接。

.val / .attr / .hasclass I use to identify pre-set values. I usually use custom attributes on elements, and getting them back with attr is great. Like storing if I've already pre-loaded content of an element. The rest is pretty straight forward.

这篇关于最有用的jQuery本机API函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆