jQuery Call a Function in Addition to some other code
<p>I'm trying to call a function into another function to get rid of some redundant code. The 'test' function is a standard piece of repetitive code, so I don't want to keep writing it out along with the custom animation.</p>

<pre><code>(function test() {
    do this
});    

/* =========================Standard code========================= */
$(function () {
$('#div').click(EXECUTE THE 'TEST' FUNCTION HERE AND THEN...function() {
    $('#timeline').stop().animate({
        left : "+=500px"
    });
});
</code></pre>

<p>});</p>

<p>Here is the solution thanks to the kind guys below:</p>

<pre><code>function test() {
    do this
}

/* =========================Standard code========================= */
$(function () {
$('#div').click(function() {
    test();
    $('#timeline').stop().animate({
        left : "+=500px"
    });
});
</code></pre>
