jQuery multiple document ready queue order

前端 未结 4 1009
忘掉有多难
忘掉有多难 2021-01-05 03:33

I know calls to $(function(){ }) in jQuery are executed in the order that they are defined, but I\'m wondering if you can control the order of the queue?

For example

4条回答
  •  独厮守ぢ
    2021-01-05 03:53

    It can be done, but not easily. You'd have to hack jQuery itself, probably here. Before jQuery starts calling these functions inside the while loop, you'd have to add code to inspect the readyList array and re-order the elements according to your preference.

提交回复
热议问题