1

I have a javascript file that call with $ajax a php script.

$.ajax({
    url : "myscript.php",
    success : function (data) {
          doSomething();
    },
    error : function (data) {
                  doSomethingElse();
    }
});

My php script will print more output during the process, one at a time.

Can I visualize these output asynchronously while the php script is processing?

Or I have to wait the end and show all togheter the output string from php script?

Thank you.

michele
  • 26,348
  • 30
  • 111
  • 168

1 Answers1

1

You cannot retrieve parts of the response until the response is complete. You will have to implement AJAX requests that provide status information.

just lerning
  • 876
  • 5
  • 20
  • This will require some effort. You can find related questions at http://stackoverflow.com/questions/17673562/ and http://stackoverflow.com/questions/14569394/ and http://stackoverflow.com/questions/2876945/. – just lerning Nov 02 '13 at 11:40