Wait for function to finish before executing the rest
<p>When the user refreshes the page, <code>defaultView()</code> is called, which loads some UI elements. <code>$.address.change()</code> should execute when <code>defaultView()</code> has finished, but this doesn't happen all the time. <code>$.address.change()</code> cannot be in the <code>success:</code> callback, as it's used by the application to track URL changes.</p>

<pre><code>defaultView();

function defaultView() {
    $('#tout').fadeOut('normal', function() {
        $.ajax({
            url: "functions.php",
            type: "GET",
            data: "defaultview=true",
            async: false,
            success: function (response) {
                $('#tout').html(response).fadeIn('normal');
            }
        });
    });
}

$.address.change(function(hash) {
    hash = hash.value;
    getPage(hash);
});
</code></pre>

<p>I'm at a loss as to how to make <code>$.address.change()</code> wait for <code>defaultView()</code> to finish. Any help would be appreciated.</p>
