How to trigger $().ready() in jQuery?

前端 未结 10 1068
谎友^
谎友^ 2020-11-30 12:49

Using jQuery, is there a way to retrigger the document.ready trigger at some point after a page has loaded?

Update: jQuery sheds them once they are run.

10条回答
  •  死守一世寂寞
    2020-11-30 13:15

    Easy: you just need to disable the safety-flag jQuery.isReady. Set jQuery.isReady to false and use jQuery(document).trigger('ready') to re-trigger this event. That's quite useful for turbolinks-style navigation.

提交回复
热议问题