jQuery events .load(), .ready(), .unload()

前端 未结 4 691
情深已故
情深已故 2020-11-28 20:26

Just a simple question, for the jQuery event. Are the .load(), .ready() and .unload() run in order when the DOM is loaded? The answer seems yes when I see the jQuery Documen

4条回答
  •  天命终不由人
    2020-11-28 21:15

    If both "document.ready" variants are used they will both fire, in the order of appearance

    $(function(){
        alert('shorthand document.ready');
    });
    
    //try changing places
    $(document).ready(function(){
        alert('document.ready');
    });
    

提交回复
热议问题