javascript - AJAX request question
習慣沉默
習慣沉默 2017-07-05 11:05:09
0
1
799

Native JS, using AJAX, taking GET as an example
Previously, the network was interrupted after 1 second of AJAX submission (the request content was not returned within 1 second due to network and program reaction reasons), but after the network was restored (with a short timeout A few seconds later) but the request content can continue to be received.
If there is no network currently, and then click Submit AJAX to restore the network one second later, in this case, after the network is restored, will AJAX continue to send requests?
?

習慣沉默
習慣沉默

reply all (1)
阿神

Not necessarily.

After AJAX sends a request, it cannot determine whether the network has been disconnected (now HTML5 has added the network status API), so ajax will continue to be sent until timeout. If you reply to the network before timeout, ajax will also be sent.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!