That is basically what I do, I think, but as I return the HTML as a result to a function I use GetString(). The HTML should be the same on the client though. After the upload is complete (when it works, it only works about half the times - see my other post regarding temp directory) it just sits there. Hitting F5 will reload the page. I have a list on it with uploaded files that I want to refresh after the upload is complete.
My code:
". GetUploadHandlerAjaxScript( 'mediaUploader', '/musicbase/upload_media_handler.php' ) ."
<form method=post action='/index.php'>
<input type=hidden name='". MUSICBASE_CMD ."' value='". POST_ALBUM ."'>
<input type=hidden name=album_id value=". fldInteger( $_REQUEST[ 'album_id' ], $conMB ) .">
<div style='float:left; width:340px;'>
$media
</div>
<div style='float:left; width:240px; padding-left:10px;'>
". $uploader->GetString() ."
<div class='divInstructions' style='width:260px;'>
<h2>Instruktioner</h2>
<p>
Du kan ladda upp en eller flera filer samtidigt och lägga till eller avbryta medans de laddas upp. Lämna inte sidan innan alla filer laddats upp.
</p>
</div>
</div>
</form>
";
return $res;