How do I show the print with AJAX/jQuery?

Posted by Doug on Stack Overflow See other posts from Stack Overflow or by Doug
Published on 2010-05-01T23:08:40Z Indexed on 2010/05/01 23:17 UTC
Read the original article Hit count: 213

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about jQuery