$.when 必須接收一個(gè)$.Deferred() 返回的對(duì)象,這個(gè)對(duì)象里面鏈?zhǔn)讲僮鱠one或fail方法
2015-03-08
然后
ajQuery.prototype.init.prototype = ajQuery.prototype;
//得到選擇器名字
var m = $$('aaa');
alert(m.selectorName()) ;
ajQuery.prototype.init.prototype = ajQuery.prototype;
//得到選擇器名字
var m = $$('aaa');
alert(m.selectorName()) ;
2015-03-05
那個(gè)fn就是個(gè)別名,也可以這樣寫(xiě)
var $$ = ajQuery = function(selector) {
return new ajQuery.prototype.init(selector);
}
ajQuery.prototype = {
init:function(selector){
this.selector = selector;
},
selectorName:function(){
return this.selector;
},
constructor: ajQuery
}
var $$ = ajQuery = function(selector) {
return new ajQuery.prototype.init(selector);
}
ajQuery.prototype = {
init:function(selector){
this.selector = selector;
},
selectorName:function(){
return this.selector;
},
constructor: ajQuery
}
2015-03-05
@zmj_ 你理解錯(cuò)了, “所以要修正一下constructor屬性” 根本不是這樣的 那個(gè)只是起個(gè)說(shuō)明作用
2015-03-05
不知道這個(gè)是哪個(gè)版本的源碼
我看1.7.2的源碼 doScrollCheck()這部分自調(diào)用函數(shù) 已經(jīng)拖出去了
我看1.7.2的源碼 doScrollCheck()這部分自調(diào)用函數(shù) 已經(jīng)拖出去了
2015-03-04
$$('aaron')是ajQuery.prototype.init的實(shí)例化對(duì)象,
如果init的prototype沒(méi)有關(guān)聯(lián)ajQuery.prototype,他也就沒(méi)有name屬性,
當(dāng)ajQuery.prototype.init.prototype = ajQuery.prototype后,
$$('aaron')就具有了ajQuery.prototype所有的屬性和方法,即實(shí)例方法共用了靜態(tài)方法
如果init的prototype沒(méi)有關(guān)聯(lián)ajQuery.prototype,他也就沒(méi)有name屬性,
當(dāng)ajQuery.prototype.init.prototype = ajQuery.prototype后,
$$('aaron')就具有了ajQuery.prototype所有的屬性和方法,即實(shí)例方法共用了靜態(tài)方法
2015-03-02