In the old jquery one could add a function to the top of document.ready like this:
$.readyList.unshift(function () {
Now this is not possible anymore. Is there another way to move one function to the top? Our ASP.NET pages consist of different controls that all have their own document.ready, so it is currently impossible for me to change this. But I need one function to run before all others.
Is there another "clean" way to do this?
from here:
It's due to the fact that ready is (and should be) an event - the fact that some of the internals were exposed was a mistake (one that we're working to rectify). As you mentioned it was undocumented and its exposure was unintended.
Though I'm not sure what prevents you from writing your own list (or extend jquery) with a new readyList:
var readyList = [func1, func2, func3 ...];
and executing it one by one in .ready()
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With