How do I show the print with AJAX/jQuery?
- by Doug
So I'm trying to understand this whole AJAX/jQuery thing. Right now, when I run this PHP script alone, I would have to wait and watch the wheel spin until it's done with the loop and then it will load.
while ( $row = mysql_fetch_array($res) ) {
postcode_to_storm( $row['Test'] );
$dom = new DOMDocument();
@$dom->loadHTML($result);
$xPath = new DOMXPath($dom);
$failInvite = 'Rejected';
$findFalse = strpos($result, $failInvite);
if ( $findFalse == true ) {
$array[$i] = $row['Test'];
$i++;
echo $array[$i]};
}
}
Now, how do I use AJAX/jQuery to show echo $array[$i]}; everytime it is invoked instead of waiting for the whole process to complete?