简体   繁体   中英

asynchronous request/response with jquery ajax and php

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM