JavaScript:如何在等待ajax响应时阻止整个屏幕 [英] JavaScript: How to block the whole screen while waiting for ajax response

查看:86
本文介绍了JavaScript:如何在等待ajax响应时阻止整个屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个屏幕,其中有不同的功能。有一个下拉框,其中有一个Ajax调用,并返回一个jsp页面作为响应。这个响应我然后放在我的下拉框下面的div。
现在我想要的是,直到这个jsp未填充div元素,屏幕被警告框或其他对话框阻止。
我怎样才能实现这个目标?

I have a screen in which there are different functions. There is a dropdown box onchange of which an Ajax call goes and a jsp page is returned in response. This response i then put inside a div below my dropdown box. Now what i want is that untill this jsp is not filled in the div element the screen is blocked either by an alert box or some other dialog box. How can i achieve this ?

推荐答案

如果你真的想要阻止UI,只需要发出AJAX请求同步

If you actually want to block the UI, just make the AJAX request synchronous.

这篇关于JavaScript:如何在等待ajax响应时阻止整个屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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