锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品亚洲高清一区二区,在线亚洲精品福利网址导航,91亚洲国产在人线播放午夜http://www.tkk7.com/heavensay/category/53972.htmlzh-cnTue, 29 Oct 2013 13:40:08 GMTTue, 29 Oct 2013 13:40:08 GMT60jQuery鍒嗘瀽綰http://www.tkk7.com/heavensay/archive/2013/10/29/405733.htmlheavensayheavensayTue, 29 Oct 2013 12:18:00 GMThttp://www.tkk7.com/heavensay/archive/2013/10/29/405733.htmlhttp://www.tkk7.com/heavensay/comments/405733.htmlhttp://www.tkk7.com/heavensay/archive/2013/10/29/405733.html#Feedback0http://www.tkk7.com/heavensay/comments/commentRss/405733.htmlhttp://www.tkk7.com/heavensay/services/trackbacks/405733.html
jQuery鐩稿叧瀵硅薄鍐呭瓨鍥?/strong>



    jQuery浠g爜鍒嗘瀽綰錛?/strong>
        1銆?jQuery涓鍔犺澆榪涙潵錛屽氨鎵ц鍖垮悕鍑芥暟錛岃繘琛宩Query鐨勫垵濮嬪寲宸ヤ綔錛屽畾涔塲Query鐨勫姛鑳斤紝鏈鍚庢毚闇插嚭jQuery鍜?鍙橀噺緇欑敤鎴蜂嬌鐢ㄣ?br />
(function( window, undefined ) {

window.jQuery = window.$ = jQuery
})( window );

        2銆?jQuery鍔熻兘鎵╁睍鍑芥暟Extend
jQuery.extend = jQuery.fn.extend = function() {
    
}
        jQuery鎻愪緵浜?涓緵鐢ㄦ埛鎵╁睍鐨勫嚱鏁癹Query.extend鍜宩Query.fn.extend銆?/div>
        jQuery.extend 鐢ㄤ簬鎵╁睍jQuery鑷韓鏂規(guī)硶錛屽jQuery.ajax, jQuery.getJSON絳夛紝jQuery.fn.extend鍒欐槸鐢ㄤ簬鎵╁睍jQuery(...)鐨勬柟娉曪紝浠庝笂闈㈢殑鍐呭瓨鍥句腑鍙互鐪嬪嚭錛岀粡榪噅Query鍖呰鍚庣殑dom鍏冪礌錛屽湪鍏跺師鍨嬮摼涓婁細鎷ユ湁jQuery.fn.extend鎵╁睍鐨勬柟娉曘?/div>
        3銆?jQuery鍑芥暟錛屽氨鏄垜浠鉤甯?('#id')鎵鎵ц鐨勫嚱鏁幫紝榪斿洖鍖呰榪囩殑dom鍏冪礌
   // Define a local copy of jQuery
    jQuery = function( selector, context ) {
        // The jQuery object is actually just the init constructor 'enhanced'
        return new jQuery.fn.init( selector, context, rootjQuery );
    },


heavensay 2013-10-29 20:18 鍙戣〃璇勮
]]>Js涓璓rototype銆乢_proto__銆丆onstructor銆丱bject銆丗unction鍏崇郴浠嬬粛http://www.tkk7.com/heavensay/archive/2013/10/20/405440.htmlheavensayheavensaySun, 20 Oct 2013 15:47:00 GMThttp://www.tkk7.com/heavensay/archive/2013/10/20/405440.htmlhttp://www.tkk7.com/heavensay/comments/405440.htmlhttp://www.tkk7.com/heavensay/archive/2013/10/20/405440.html#Feedback1http://www.tkk7.com/heavensay/comments/commentRss/405440.htmlhttp://www.tkk7.com/heavensay/services/trackbacks/405440.html
涓    Prototype銆乢_proto__涓?/span>Object銆丗unction鍏崇郴浠嬬粛

        Function銆丱bject錛欽s鑷甫鐨勫嚱鏁板璞°?/div>
        prototype,姣忎竴涓嚱鏁板璞¢兘鏈変竴涓樉紺虹殑prototype灞炴?瀹冧唬琛ㄤ簡瀵硅薄鐨勫師鍨?Function.prototype鍑芥暟瀵硅薄鏄釜渚嬪錛屾病鏈塸rototype灞炴?銆?/span>
        __proto__:姣忎釜瀵硅薄閮芥湁涓涓悕涓篲_proto__鐨勫唴閮ㄩ殣钘忓睘鎬э紝鎸囧悜浜庡畠鎵瀵瑰簲鐨勫師鍨嬪璞?/span>(chrome銆乫irefox涓悕縐頒負__proto__錛屽茍涓斿彲浠ヨ璁塊棶鍒?銆?/span>鍘熷瀷閾炬鏄熀浜巁_proto__鎵嶅緱浠ュ艦鎴?note錛氫笉鏄熀浜庡嚱鏁板璞$殑灞炴rototype)銆?/span>
       鍏充簬涓婇潰鎻愬埌鐨勫嚱鏁板璞★紝鎴戜滑鏉ョ湅浠ヤ笅渚嬪瓙錛屾潵璇存槑錛?br />
        var o1 = {};
        var o2 =new Object();
        
        function f1(){}
        var f2 = function(){}
        var f3 = new Function('str','console.log(str)');
    
        f3('aabb');   // aabb
        console.log('typeof Object:'+typeof Object);            //function
        console.log('typeof Function:'+typeof Function);        //function
        console.log('typeof o1:'+typeof o1);   //object
        console.log('typeof o2:'+typeof o2);   //object
        console.log('typeof f1:'+typeof f1);   //function
        console.log('typeof f2:'+typeof f2);   //function
        console.log('typeof f3:'+typeof f3);   //function
  • 閫氬父鎴戜滑璁や負o1銆乷2鏄璞★紝鍗蟲櫘閫氬璞★紱f1銆乫2銆乫3涓哄嚱鏁般?/span>
  • 浣嗘槸鍏跺疄鍑芥暟涔熸槸瀵硅薄錛屾槸鐢盕unction鏋勯犵殑錛?/span>
  • f3榪欑鍐欐硶灝辮窡瀵硅薄鐨勫垱寤虹殑鍐欐硶涓鏍楓?/span>f1銆乫2鏈緇堜篃閮藉儚f3涓鏍鋒槸鏈塅unction榪欎釜鍑芥暟鏋勯犲嚭鏉ョ殑
  • f1銆乫2銆乫3涓哄嚱鏁板璞★紝Function璺烵bject鏈韓涔熸槸鍑芥暟瀵硅薄銆?/span>
       Js涓瘡涓璞?null闄ゅ)閮藉拰鍙︿竴涓璞$浉鍏寵仈錛?/span>閫氳繃浠ヤ笅渚嬪瓙璺熷唴瀛樻晥鏋滃浘鏉ュ垎鏋怓unction銆丱bject銆丳rototype銆乢_proto__瀵硅薄闂寸殑鍏崇郴銆?/span>

    function Animal(){
        
    }
    var  anim = new Animal();
    
    console.log('***********Animal anim proto*****************');
    console.log('typeof Animal.prototype:' +typeof Animal.prototype);  //object 
    console.log('anim.__proto__===Animal.prototype:'+(anim.__proto__===Animal.prototype));  //true
    console.log('Animal.__proto__===Function.prototype:'+(Animal.__proto__===Function.prototype));  //true
    console.log('Animal.prototype.__proto__===Object.prototype:'+(Animal.prototype.__proto__===Object.prototype));  //true
    
    console.log('***********Function proto*****************');
    console.log('typeof Function.prototype:'+typeof Function.prototype);  //function
    console.log('typeof Function.__proto__:'+typeof Function.__proto__);  //function
    console.log('typeof Function.prototype.prototype:'+typeof Function.prototype.prototype); //undefined
    console.log('typeof Function.prototype.__proto__:'+typeof Function.prototype.__proto__);   //object
    console.log('Function.prototype===Function.__proto__:'+(Function.prototype===Function.__proto__)); //true

    console.log('***********Object proto*****************');
    console.log('typeof Object.prototype:'+typeof Object.prototype);  //object
    console.log('typeof Object.__proto__:'+typeof Object.__proto__);  //function
    console.log('Object.prototype.prototype:'+Object.prototype.prototype);  //undefied
    console.log('Object.prototype.__proto__===null:'+(Object.prototype.__proto__===null));  //null

    console.log('***********Function Object  proto鍏崇郴*****************');
    console.log('Function.prototype===Object.__proto__:'+(Function.prototype===Object.__proto__));   //true
    console.log('Function.__proto__===Object.__proto__:'+(Function.__proto__===Object.__proto__));   //true
    console.log('Function.prototype.__proto__===Object.prototype:'+(Function.prototype.__proto__===Object.prototype));   //true

    /********************* 緋葷粺瀹氫箟鐨勫璞rray銆丏ate ****************************/
    console.log('**************test Array銆丏ate****************');      
    var array = new Array();
    var date = new Date();
    console.log('array.__proto__===Array.prototype:'+(array.__proto__===Array.prototype));   //true
    console.log('Array.__proto__===Function.prototype:'+(Array.__proto__===Function.prototype));  //true
    console.log('date.__proto__===Date.prototype:'+(date.__proto__===Date.prototype));    //true
    console.log('Date.__proto__===Function.prototype:'+(Date.__proto__===Function.prototype));     //true

Function銆丱bject銆丳rototype銆乢_proto__鍐呭瓨鍏崇郴鍥?/strong>


        涓婇潰鐨勫唴瀛樺浘璺熷爢鏍堢粨鏋勫彲浠ュ弬鐓ф枃绔?/span>Javascript_01_鐞嗚В鍐呭瓨鍒嗛厤銆?br />        鍫嗗尯鍥捐鏄庯細
 
        Function.prototype鍑芥暟瀵硅薄鍥懼唴閮ㄨ〃紺簆rototype灞炴х殑綰㈣壊铏氭錛屽彧鏄負浜嗚鏄庤繖涓睘鎬т笉瀛樺湪銆?/span>

        閫氳繃涓婂浘Function銆丱bject銆丳rototype鍏崇郴鍥句腑錛屽彲浠ュ緱鍑轟竴涓嬪嚑鐐癸細
  1. 鎵鏈夊璞℃墍鏈夊璞★紝鍖呮嫭鍑芥暟瀵硅薄鐨勫師鍨嬮摼鏈緇堥兘鎸囧悜浜哋bject.prototype錛岃孫bject.prototype.__proto__===null錛屽師鍨嬮摼鑷蟲緇撴潫銆?/span>
  2. Animal.prototype鏄竴涓櫘閫氬璞°?/span>
  3. Object鏄竴涓嚱鏁板璞★紝涔熸槸Function鏋勯犵殑錛孫bject.prototype鏄竴涓櫘閫氬璞°?/span>
  4. Object.prototype.__type__鎸囧悜null銆?/span>
  5. Function.prototype鏄竴涓嚱鏁板璞★紝鍓嶉潰璇村嚱鏁板璞¢兘鏈変竴涓樉紺虹殑prototype灞炴э紝浣嗘槸Function.prototype鍗存病鏈塸rototype灞炴э紝鍗矲unction.prototype.prototype===undefined錛屾墍鏈塅unction.prototype鍑芥暟瀵硅薄鏄竴涓壒渚嬶紝娌℃湁prototype灞炴с?/span>
  6. Object铏芥槸Function鏋勯犵殑涓涓嚱鏁板璞★紝浣嗘槸Object.prototype娌℃湁鎸囧悜Function.prototype錛屽嵆Object.prototype!==Function.prototype銆?/span>

浜?   Prototype璺烠onstructor鍏崇郴
浠嬬粛
         鍦?JavaScript 涓紝姣忎釜鍑芥暟瀵硅薄閮芥湁鍚嶄負“prototype”鐨勫睘鎬?span style="font-size: 10.5pt; line-height: 1.5;">(涓婇潰鎻愬埌榪嘑unction.prototype鍑芥暟瀵硅薄鏄釜渚嬪錛屾病鏈塸rototype灞炴?錛岀敤浜庡紩鐢ㄥ師鍨嬪璞°傛鍘熷瀷瀵硅薄鍙堟湁鍚嶄負“constructor”鐨勫睘鎬э紝瀹冨弽榪囨潵寮曠敤鍑芥暟鏈韓銆傝繖鏄竴縐嶅驚鐜紩鐢紙i.e. Animal.prototype.constructor===Animal錛夈?/span>
        閫氳繃浠ヤ笅渚嬪瓙璺熷唴瀛樻晥鏋滃浘鏉ュ垎鏋怭rototype銆乧onstructor闂寸殑鍏崇郴銆?/span>
    console.log('**************constructor****************'); 

    console.log('anim.constructor===Animal:'+(anim.constructor===Animal))    ;    //true
    console.log('Animal===Animal.prototype.constructor:'+(Animal===Animal.prototype.constructor))    ;    //true
    console.log('Animal.constructor===Function.prototype.constructor:'+(Animal.constructor===Function.prototype.constructor));   //true
    console.log('Function.prototype.constructor===Function:'+(Function.prototype.constructor===Function));    //true
    console.log('Function.constructor===Function.prototype.constructor:'+(Function.constructor===Function.prototype.constructor));    //true

    console.log('Object.prototype.constructor===Object:'+(Object.prototype.constructor===Object));    //true
    console.log('Object.constructor====Function:'+(Object.constructor===Function));    //true

 prototype銆乧onstructor鍐呭瓨鍏崇郴鍥?鍦‵unction銆丱bject銆丳rototype鍏崇郴鍥句笂鍔犲叆constructor鍏冪礌)錛?/span>


        涓婂浘涓紝綰㈣壊綆ご琛ㄧず鍑芥暟瀵硅薄鐨勫師鍨嬬殑constructor鎵鎸囧悜鐨勫璞°?/div>
  1. 娉ㄦ剰Object.constructor===Function錛涙湰韜玂bject灝辨槸Function鍑芥暟鏋勯犲嚭鏉ョ殑        
  2. 濡備綍鏌ユ壘涓涓璞$殑constructor錛屽氨鏄湪璇ュ璞$殑鍘熷瀷閾句笂瀵繪壘紕板埌鐨勭涓涓猚onstructor灞炴ф墍鎸囧悜鐨勫璞°?/span>
鍙傝冿細
http://www.cnblogs.com/fool/category/264215.html (javascript鍘熺悊浠嬬粛)
http://www.libuchao.com/2012/05/14/prototypes-in-javascript/ (JavaScript 鐨勫師鍨嬪璞?Prototype)
http://rockyuse.iteye.com/blog/1426510 (鐞嗚Вjs涓殑鍘熷瀷閾撅紝prototype涓巁_proto__鐨勫叧緋?





heavensay 2013-10-20 23:47 鍙戣〃璇勮
]]> 主站蜘蛛池模板: 亚洲国产品综合人成综合网站| 国产.亚洲.欧洲在线| 午夜视频免费在线观看| 亚洲高清日韩精品第一区| 免费看少妇作爱视频| 中文字幕的电影免费网站| 亚洲国产精品久久人人爱| 宅男666在线永久免费观看| 成在线人视频免费视频| 亚洲欧洲在线播放| 亚洲精品和日本精品| 国产在线观看麻豆91精品免费| 国产亚洲欧美在线观看| 亚洲AV日韩精品久久久久| 国产成人免费永久播放视频平台| 日本免费污片中国特一级| 亚洲日本一线产区和二线| 亚洲国产精品特色大片观看完整版| 福利免费观看午夜体检区| 中文字幕免费在线看线人动作大片| 亚洲日本人成中文字幕| 亚洲国产精品嫩草影院在线观看| 日本免费高清一本视频| 99精品一区二区免费视频| 免费人人潮人人爽一区二区| 亚洲1234区乱码| 亚洲av色福利天堂| 久久久久亚洲AV成人网人人软件| 日韩免费a级毛片无码a∨| 免费观看91视频| 一级一黄在线观看视频免费| 亚洲无吗在线视频| 亚洲福利视频网站| 亚洲精品高清无码视频| 亚洲国产精品碰碰| 日韩免费无码一区二区视频| 亚洲视频在线观看免费视频| 可以免费观看的毛片| 国产精品免费久久久久久久久| 国产精品亚洲专区无码WEB| 亚洲香蕉久久一区二区三区四区|