dongling4383 2013-09-10 18:23 采纳率: 100%
浏览 70

Jquery Post / AJAX - 带代码的关闭窗口是否会影响服务器脚本?

To preface, I know this isn't a great question and it will be hard to explain.

I have a PHP script that takes 5-10 minutes to run. I don't want the user to have to wait for it. If I "trigger" the script using jquery ajax, and then the user navigates away from that page or closes the browser (and doesn't wait for the response (if any) which will come much later), will the script still execute fully (assuming there are no errors etc)

Thanks!

  • 写回答

3条回答 默认 最新

  • dongtu4559 2013-09-10 18:31
    关注

    Once the server receives the AJAX Request along with the data, it would process it as usual, even if you close the page or the window. If you close the browser window before the server receives the AJAX Request, the processing it not going to happen.

    Furthermore, if the AJAX Request is returning any kind of data or displaying messages, it is advised that you leave the window open, so that there is some "Listening" page to the Server's Request Response.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题