onbeforeunload的等待AJAX​​结果 [英] onbeforeunload wait for ajax result

查看:95
本文介绍了onbeforeunload的等待AJAX​​结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能为 onbeforeunload的()函数等待AJAX​​的结果,并移动到基于该resultvalue JSP或卸载之前ATLEAST显示一条消息?

Is it possible for onbeforeunload() function to wait for ajax result and move to a jsp based on the resultvalue or atleast show a message before unloading?

时有可能使用的setTimeout或一些自定义等功能,对于这个问题还是我必须想一些其他的工作流程

IS it possible to use setTimeOut or some custom wait function for this problem or i have to think of some other workflow

推荐答案

使用一个同步XmlHtt prequest电话(AJAX是一个错误nomer)。

Use a synchronous XmlHttpRequest call ("AJAX" is a mis-nomer).

这篇关于onbeforeunload的等待AJAX​​结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆