Assuming a page that has multiple events being associated via jQuery. For example, in a certain section, I have:
$().ready(function() {
foo();
});
And more ahead I have:
$().ready(function() {
bar();
});
And several more lines below ...
$().ready(function() {
VoceJahEntendeuAIdeia();
});
Now supposing I want to force the order of execution of the events. Is there any way to do bar();
rotate before foo();
, which does not necessarily involve changing the two position or modifying the jQuery code?
The reason is that I'm dealing with code injected into the application through the load
and ready
events of jQuery, for components of a framework I'm using. Such a framework necessarily injects its last code into the page load, but I really need my code to run last. And I find the use of setTimeout
/ setInterval
inelegant.