What jQuery event is called right after $(document).ready()?

前端 未结 8 908
囚心锁ツ
囚心锁ツ 2021-01-13 08:47

I have lots of HTML generated on $(document).ready(). I have a simple window system. But not only it is generated on $(document).ready() - also som

8条回答
  •  逝去的感伤
    2021-01-13 09:20

    There is another event which is fired later. it's $(window).load(); This is fired after all resources are loaded.

    But perhaps you want this:

    function loadWindowSystem(){
        // load window system here
    }
    
    $(document).ready(function(){
        // do some html stuff here
    
        loadWindowSystem();
    })
    

    This way you can separate your code in functions.

提交回复
热议问题