Server:
$data = array();
$data[] = 'lady gaga';
$data[] = 'luna maya';
$data[] = 'barack obama';
echo json_encode($data);
Client:
$data = eval('('+ajax.responseText+')');
for(i=0; i<data.length; i++){
element.innerHTML = innerHTML + data[i];
}
No comments:
Post a Comment