8
Suppose a page has several events being associated via jQuery. For example, in a given section, I have:
$().ready(function() {
foo();
});
And further ahead I have:
$().ready(function() {
bar();
});
And several lines further down...
$().ready(function() {
VoceJahEntendeuAIdeia();
});
Now suppose I wish to force the order of execution of events. Is there any way to do bar();
rotate before foo();
, which does not necessarily involve changing the two positions or modifying the jQuery code?
The reason is that I’m dealing with code injected into the application through events load
and ready
jQuery, by components of a framework I’m using. Such a framework necessarily injects its own code last on the page load, but I really need my code to run last. And I find the use of setTimeout
/setInterval
inelegant.
A way would be a function of
callback
to be called after the framework, but without a more concrete idea of how things are happening, it is difficult to provide an adequate solution to the scenario in question. You can add a little more information about the way this code framework is being injected?– Zuul