weixin_33739646 2015-06-19 08:24 采纳率: 0%
浏览 3

jQuery load()实时结果?

I have a simple page that when the submit button is clicked I load a page using load()

eg:

$("#res").load("do.php");

do.php contains a few simple command that are run and return the results to screen.

If I run do.php directly in my browser I get the results displayed on screen in real time as they script runs then and gets the results back.

However when called from another page using load() I only get the results page once do.php has completely finished.

Is there any way to call do.php from another page and have its results returned live ?

do.php contains simple commands similar to:

<?php
$cmd = 'ping 127.0.0.1';

while (@ ob_end_flush());

$proc = popen($cmd, 'r');
echo '<pre>';
while (!feof($proc))
{
    echo fread($proc, 4096);
    @ flush();
}
echo '</pre>';
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?