I have a page with some jQuery and a separate function other than jQuery.
My function currently works on $ (document) .ready, but I want to call the jQuery function as soon as my function is complete. I can pass my function as a callback to any jQuery function, but how can I configure everything the other way around?
Therefore, I would like to know how to create a foo function that will take care of this for me:
$(document).ready(function() {
foo(myfunction(), $(bar).something);
}
or how to extend an existing function to handle callbacks. Thanks.
source
share