Hola,
os dejo el código, está un poco guarro xq es sólo para pruebas.
Código PHP:
<?php
require ('../xajax_core/xajax.inc.php');
$xajax = new xajax();
function vcc($isCaps,$res){
if (($isCaps%2)==0){
$text='<td width="70">Hola</td>';
}else{
$text='<td width="70">HOLA</td>';
}
$res=$res.$text;
$objResponse = new xajaxResponse();
$objResponse->assign("vcc","innerHTML",$res);
return $objResponse;
}
function pcc($isCaps,$res){
if (($isCaps%2)==0){
$algo='<td width="70">LINEAL</td>';
}else{
$algo='<td width="70">lineal</td>';
}
$res=$res.$algo;
$objResponse = new xajaxResponse();
$objResponse->assign("pcc","innerHTML",$res);
return $objResponse;
}
$xajax->registerFunction("vcc");
$xajax->registerFunction("pcc");
$xajax->processRequest();
echo '<?xml version="1.0" encoding="UTF-8"?>';
$xajax->printJavascript('../');
?>
<script type='text/javascript'>
/* <![CDATA[ */
var texto;
window.onload = function() {
// call the helloWorld function to populate the div on load
xajax_vcc(0,'');
xajax_pcc(0,'');
}
var i=0;
//i=i+1;
setInterval("xajax_vcc(i++,texto)",1000);
setInterval("xajax_pcc(i++,texto)",1000);
/* ]]> */
</script>
<table border='1'><tr><td>PCC</td><td>VCC</td></tr><tr><td width="70"><div id="pcc" name="pcc"><? echo "pcc"?></div></td>
<td width="70"><div id="vcc" name="vcc"><? echo "vcc"?></div></td>
</tr></table>
<br/>
Saludos.