快速返回值

I have a page there contain a form. At that page I want to get a result after submit.

For that I have added this code to get the data returned in a div:

    <script type="text/javascript">
    $(function(){
        $('#ff').form({
            success:function(data){
                $("#hest").show();
                //$.messager.alert('Info', data, 'info');
                $("#message").html(data); 
            }
        });
    });
</script>

The form submit to this php file:

<?PHP$x=0;
   while($x<=100)
     {
         echo "The number is: $x 
";
         $x++;
         sleep(1);
     } 
?>

When I submit I get the result for all 100 run of the loop, is it possible to get the result for one run of the loop, to see the progress instead of wating for all 100 runs of the loop are finish?

You could call every iteration manually instead of a loop on the server side. But i'm not sure if you should consider this as a nifty solution. This would move the loop to the client side.