This is not a jquery question.
I want to create a callback function…so users would use it like so:
myfunc.init('id',{option1: val, option2: val2}, function() {
//in here users can now call methods of myfunc
});
How do I do this within my code. OS once I know my script is ready I want to be able to somehow call this anonymous function.
Hope this makes sense. I often don’t.
You can write i t like this:
This will first run everything you want in your init function then run the function supplied as the callback parameter