简体   繁体   English

当jQuery的$(“。foo li”)返回一个对象作为结果时,该对象的确切类型是什么?

[英]When jQuery's $(“.foo li”) returns an object as a result, what exact is the type of object called?

Let's say if we initialize some selected result: 假设我们初始化一些选定的结果:

init : function() {
    this.searchButton = $("#searchButton");
    this.listItems = $("#product-list li");
}

I wonder what is the official name is for the object returned by $("#product-list li") ? 我想知道$("#product-list li")返回的对象的正式名称是什么? I sometimes called it jQuery selector object or selector, but it is somewhat vague. 我有时称它为jQuery选择器对象或选择器,但这有点含糊。 Selector can just be the string "#product-list li" , and jQuery selector object may be better, except the results and length that indicates the number of matches is all inside the object, so it is not just a selector object because the results are inside. 选择器可以只是字符串"#product-list li" ,而jQuery选择器对象可能更好,除了表示匹配数的结果和长度都在对象内部,所以它不仅仅是选择器对象,因为结果在里面。 Is there a formal name for this object? 该对象有正式名称吗? For example, if I commit the above code using svn or git, should the comment really be "initializing jQuery selector objects"? 例如,如果我使用svn或git提交上述代码,则注释是否真的应该是“初始化jQuery选择器对象”?

它的通俗名称是“ jQuery对象”,尽管就javascript而言,如果对它执行typeof ,则它只是一个普通的旧object

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

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