创建AJAX异步同时警告()被打开 [英] creating async AJAX while alert() is opened
问题描述
我的浏览器将保持活动异步调用服务器采用每20秒 window.setTimeout()
。问题:当警报()
弹出的AJAX调用暂停。如果用户驳回弹出之前等待一段时间 - 服务器会(错误地)关闭登录会话
My browser sends keep-alive async calls to the server every 20 seconds using window.setTimeout()
. The problem: when alert()
pops out, the AJAX calls are suspended. If the user waits a while before dismissing the popup - the server will (wrongly) close the login session.
我们用警报()
弹出错误信息,我不能用其他的方法,因为这是产品定义。
We use alert()
to popup error messages, and I can't use other methods since this is the product definition.
任何方式解决这个?谢谢
Any way to workaround this? Thanks
推荐答案
警报()
以及提示符()
所有阻塞UI线程,这意味着所有其他操作被禁赛。
alert()
as well as prompt()
all block the UI thread which means all other operations get suspended.
我建议你使用模态窗口来代替,如那些在jQueryUI的。
I suggest you use modal windows instead, like the ones in jQueryUI.
这篇关于创建AJAX异步同时警告()被打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!