我有一个网页,其中问题的若干阿贾克斯查询在 $('文件')。就绪()
。我想用淡入()
或动画()
来显示一些信息几秒钟收到后的第一个AJAX呼叫。
将以下JS / AJAX调用中的动画播放过程中受阻?或者,我应该使用的setTimeout延迟动画第二个这样的Ajax调用可以异步启动?
编辑:
我的code会是这样的。请问别人Ajax调用被阻塞5秒?
$阿贾克斯({...,成功:函数(结果){
$('#味精)HTML(result.xxx);
$('#味精)淡入(5000)。
//其他Ajax调用
$阿贾克斯(....)
....
}
解决方案
是的,他们是无阻塞。动画方法只是启动动画,并立即返回。
不限code表示更新用户接口必须非阻塞的,因为任何功能运行的同时在用户界面不更新
I have a page which issues several ajax queries in $('document').ready()
. I want to use fadeIn()
or animation()
to display some information for a few seconds after received the first ajax call.
Will the following js/ajax calls be blocked during the animation playing? Or should I use setTimeout to delay the animation a second so the ajax calls can be started asynchronously?
Edit:
My code will look like this. Will the others ajax calls be blocked for 5 seconds?
$.ajax({..., success: function(result) {
$('#msg').html(result.xxx);
$('#msg').fadeIn(5000);
// Other ajax calls
$.ajax(....)
....
}
解决方案
Yes, they are non-blocking. The animation methods just initiate the animation and returns immediately.
Any code that updates the user interface has to be non-blocking, as the user interface isn't updated while any function is running.
相关推荐
最新文章