Possible to make AJAX call that doesn't return?

前端 未结 4 1665
忘掉有多难
忘掉有多难 2020-12-30 11:57

Is it possible to send an jQuery.ajax call or equivalent without any sort of response? I want to trigger something on the server as I leave the page with the onbeforeunload

4条回答
  •  感动是毒
    2020-12-30 12:55

    If you are trying to return a response as soon as possible I think that is more of a server architecture decision. You can offload the actual work the request involves to a broker or something so you can return to the user as soon as possible? I don't think sending just a one way message is feasible

提交回复
热议问题