Safari ajax request Failed to load resource: The network connection was lost

前端 未结 2 723
故里飘歌
故里飘歌 2021-02-05 09:55

I\'m receiving a message \"Failed to load resource: The network connection was lost.\" in my application, which uses ajax requests to get content from

2条回答
  •  清酒与你
    2021-02-05 10:34

    Had this trouble too with a form that ajax-posted and when that completed did a window.location.reload(true). Safari 13.0.3 would work the first time after a manual page refresh (seemed consistent) then would get "Failed to load resource: The network connection was lost." roughly 2 out of 3 clicks.

    Changed the client to:

    • use ajax-get instead of post (with a unique query param value each time)

    • on completion set a timer so that window.location.reload(true) was not done inside the ajax completion handler

    User reports that worked, not sure which one of those changes or both.

    Hope this helps someone...

提交回复
热议问题