Can I call $(document).ready() to re-activate all on load event handlers?

前端 未结 10 1573
情书的邮戳
情书的邮戳 2020-12-15 15:37

Does anyone happen to know IF and HOW I could re-call all on-load event handlers? I\'m referencing some .js files that I DON\'T have control over, and these .js libraries do

10条回答
  •  失恋的感觉
    2020-12-15 15:55

    I did something like:

    // When document is ready...
    $(function(){
        onPageLoad();
    });
    
    function onPageLoad(){
      // All commands here
    }
    

    Now I can call this function anytime I need.

提交回复
热议问题