我通过 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 之外完美运行。有什么建议么?