Calling a function after an ajax query has completed
<p>I have the following code:</p>

<pre><code>function SelectAccounts() {
    if ($("#AccountID option[value='0000']").length &gt; 0) {
        $.ajax({
            url: "/Administration/Accounts/GetOptions",
            data: { ac: $('#AccountID').val()
            },
            success: function (data) {
                $('#AccountID').html(data);
                SelectProducts(true); &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;  #1
            }
        });
    }
}
</code></pre>

<p>Once the function has completed I need to call another function. Can I just call that by putting it in #1 the way I have done in the success: area of the ajax call?</p>

<p>Note that the SelectProducts function will read a value of $('#AccountID').val()  set with the .html(data).</p>
