I am using ajax in javascript to get data into same page. but I need specific variables from my php page rather then whole response..
right now I am using,
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
that is fetching everything from that page.
Edited Code-PHP:
$currentscript = $clients->curr_group_content($_POST['group']);
$scriptscount = sizeof($currentscript);
for($i=0;$i<$scriptscount;$i++){
$script[] = $currentscript[$i]['subject'];
echo $script[$i];
}
echo "$scriptcount";
JAVASCRIPT:
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
Right now, I am getting all the data from $script and $scriptcount... I want both of these but in separate manner.