Flush problem with ajax
问题 I used flush() function in infinite loop in my php page, it echoes a text each second. when i open the page in browser it works! but when i load it via jquery ajax it doesn't response! php page <?php if (ob_get_level() == 0) ob_start(); for ($i = 0; true/*$i<10*/; $i++){ echo "<br> Line to show. $i"; echo str_pad('',4096)."\n"; ob_flush(); flush(); sleep(1); } ob_end_flush(); ?> jquery code $.ajax({ url: 'res.php', beforeSend: function( ) { $('#mydiv').html('loading...'); }, success: function