【发布时间】:2011-02-24 07:50:24
【问题描述】:
我通过 xajax 成功更新了 DIV 的 innerHTML(当我单击链接时),但仅当我在函数本身中分配 HTML 时,而不是当我从其他函数调用它时。
解释
// For the sake of testing
$output=rand(20,40);
// Add new HTML to container through $output
$ajax_resp->assign('div_container','innerHTML', $output);
return $ajax_resp;
这很好用。当我通过单击链接调用此函数时,容器会更新为随机数。但是,当我将 $output 更改为
$output=$compile->show('text');
这是(简化的)
function show($var) { echo $var; }
它没有显示出来。函数show 在 xajax 之外完美运行。有什么建议吗?
【问题讨论】: