How do I pass a jQuery function parameter automatically to an outside function?
<p>I am trying to pass "term" to an outside function.</p>

<pre><code>$('#item').terminal(function(command, term) {
</code></pre>

<p>The only way I have been able to do this is by passing "term" in the function.</p>

<pre><code>myfucntion(term, 'hello world');
</code></pre>

<p>Is there a way I can do this without having to pass it each time?</p>

<p><strong>Edit:</strong></p>

<pre><code>$(function () {
    $('#cmd').terminal(function (command, term) {
        switch (command) {
            case 'start':
                cmdtxt(term, 'hello world');
                break;

            default:
                term.echo('');
        }
    }, {
        height: 200,
        prompt: '@MQ: '
    });
});

function cmdtxt(term, t) {
    term.echo(t);
}
</code></pre>
