<script type="text/javascript">
function addOption(selectId,txt,val)
{
var objOption = new Option(txt,val);
document.getElementById(selectId).options.add(objOption);
}
</script>
并且使用addScript() 调用这个方法:
function slow_function()
{
$objResponse = new xajaxResponse();
sleep(2); //we'll do nothing for two seconds
$objResponse->addAlert("All done");
return $objResponse;
}