圖片上傳不了,老出錯(cuò);就只能復(fù)制啦!這個(gè)是我自己構(gòu)造的對(duì)象,用console.log輸出看到是這樣;foo.fn.foo.init{0:div,1:div,2:div,3:div,4:div,selector:"div",init:function,aouth:"jer",age:24,add:"江西"…}jquery對(duì)象用console.log輸出像一個(gè)數(shù)組;[div,div,div,div,div,prevObject:b.fn.b.init[1],context:document,selector:"div",jquery:"1.9.1",constructor:function…]想知道它是怎么實(shí)現(xiàn)的,下面是我寫(xiě)的源碼;(function(){functionfoo(selector){returnnewfoo.prototype.init(selector);};foo.fn=foo.prototype={init:function(selector){varelems=document.getElementsByTagName(selector),len=elems.length,i=0;for(;i
jQuery對(duì)象用console.log輸出看到的很像數(shù)組是怎么實(shí)現(xiàn)的?
蕪湖不蕪
2019-03-30 09:29:40