I'd like to create a callback on a simple function.
I have this function which is called on button click:
function main(){ };
So I'd like main(), when its done to call this:
function test(){ }
function main(callback) {
// ... do your thing
callback();
}
main(function(){
alert('this is the callback speaking');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With