*Note: Re-writing question:
I am trying to write the following outside of the individual function calls:
example:
function f1(){
You could simply call the second function at the end of the first.
$(document).ready(function() {
function firstFunction(){
alert("this is the first function!");
secondFunction();
}
function secondFunction(){
alert("this is the second function!");
}
firstFunction();
});
fiddle
Alternatively, if you do not wish to call the second function every time you call the first, you could simply call them sequentially
firstFunction();
secondFunction();
This works because it will wait until firstFunction
is done before it moves on to secondFunction
fiddle