Is it safe to call $(document).ready() from inside a function?

前端 未结 3 1121
逝去的感伤
逝去的感伤 2021-01-06 01:35

If I use the $(document).ready() handler from within a function, will it still guarantee that the code inside it will only be run if the document is ready, even

3条回答
  •  感动是毒
    2021-01-06 01:49

    Yes. You can put it inside a function, and it'll fire whenever you call that function.

提交回复
热议问题