I have a page with some jQuery, and a separate non-jQuery function.
Currently my function runs on $(document).ready, but I want to call a jQuery function as soon as my function is finished. I can pass my function as a callback to any jQuery function, but how can I set things up the other way round?
So I would ideally like to know how to create a function foo 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.