最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery中ready()函數(shù)執(zhí)行的時機(jī)和window的load事件比較

 更新時間:2015年06月22日 10:30:57   投稿:hebedich  
這篇文章主要介紹了jquery中ready()函數(shù)執(zhí)行的時機(jī)和window的load事件比較的相關(guān)資料,需要的朋友可以參考下

jquery的ready()實現(xiàn)的是 DOMContentLoaded 事件,DOMContentLoaded與window load事件的區(qū)別

簡單的說ready()是在文檔加載完成就會觸發(fā),此時圖片等資源可能還沒有完全加載, load是在所有資源都加載完成后才會觸發(fā)

看下ready函數(shù)的代碼就什么都清楚了。下面的代碼加上了注釋:

// Handle when the DOM is ready
    ready: function() {
        // Make sure that the DOM is not already loaded
        if ( !jQuery.isReady ) {
            // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
            if ( !document.body ) {
                return setTimeout( jQuery.ready, 13 );
            }

            // Remember that the DOM is ready
            jQuery.isReady = true;

            // If there are functions bound, to execute
            if ( readyList ) {
                // Execute all of them
                var fn, i = 0;
                while ( (fn = readyList[ i++ ]) ) {
                    fn.call( document, jQuery );
                }

                // Reset the list of functions
                readyList = null;
            }

            // Trigger any bound ready events
            if ( jQuery.fn.triggerHandler ) {
                jQuery( document ).triggerHandler( "ready" );
            }
        }
    },

以上所述就是本文的全部內(nèi)容了,希望大家能夠喜歡。

相關(guān)文章

最新評論

武威市| 牡丹江市| 屏东市| 柳河县| 仁布县| 卢龙县| 秀山| 呼图壁县| 尉犁县| 留坝县| 北海市| 惠安县| 于都县| 扬州市| 吴江市| 涞源县| 思南县| 德清县| 西畴县| 余江县| 当涂县| 兴海县| 濮阳县| 临江市| 营山县| 祁门县| 玉溪市| 莱芜市| 威信县| 社会| 资兴市| 天镇县| 兴义市| 武强县| 莱芜市| 万宁市| 呼图壁县| 嘉兴市| 德兴市| 神木县| 闵行区|