Updating innerHTML with HTML from a php function? (using xajax) -
i'm updating innerhtml of div through xajax (when click link) when assign html in function itself, not when call different function.
to explain
// sake of testing $output=rand(20,40); // add new html container through $output $ajax_resp->assign('div_container','innerhtml', $output); return $ajax_resp;
this works fine. when call function through clicking link, container updates random number. when change $output to
$output=$compile->show('text');
which (simplified)
function show($var) { echo $var; }
it not show it. function show
works outside of xajax. suggestions?
function show($var) { echo $var; }
this function doesn't return anything, echo's value screen. however, functions want return value, can work it. basically, when do
$output=$compile->show('text');
it no input show method, because show doesn't return value. think if change following:
function show($var) { return $var; }
it work.
Comments
Post a Comment