Create a callback function within a custom jQuery function
<p>I'm not sure how to approach this as I am fairly new to jQuery. I'm wanting to create a callback function within a custom function. Here's my example:</p>

<pre><code>function doSomething() {
    var output = 'output here';
    // Do something here

    // This is where I want to create the callback function and pass output as a parameter
}
</code></pre>

<p>I want the callback function to be accessible by any number of scripts (e.g. more than one script can access this callback).</p>

<p>This function (doSomething) is not part of a plugin but rather part of another callback function itself. I've also created a var within the function and want to pass that through the callback function as well.</p>

<p>How can I do this?</p>
