JQuery modal dialog HTML not updating
<p>After clicking a button in my modal JQuery dialog, I want to update the html in the dialog to show text and an image indicating that work is in progress (spinner, etc.). When I do in the example below, the html doesn't update. It's as if that code never executes, or executes too late so the change isn't visible. However if I uncomment the alert('hey'); code, it does. What are good ways to achieve what I'm after?</p>

<pre><code>$dialog.dialog( "option", "title", 'Do lengthy work' );
$dialog.dialog( "option", "buttons", {

    "Cancel": function() { $(this).dialog("close"); },
    "Start Work": function() {

        $(this).html('Working...&lt;p/&gt;&lt;img src="http://mydomain.com/progress.gif"');
        //alert('hey');
        doLengthyWorkFunction();
        $(this).dialog('close');
    }
} );
$dialog.html('Click the Start Work button to begin.');
$dialog.dialog('open');
</code></pre>
