jQuery的Ajax和异步假挂起火狐 [英] jquery ajax with async false hangs firefox

查看:110
本文介绍了jQuery的Ajax和异步假挂起火狐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个code调用$阿贾克斯这样的:

I have a code that calls $.ajax like this :

$.ajax({

                        type: "POST",
                        url: "/sandbox/graphloader/mock3",
                        async: false,
                        data: {calInput1:dates[0], calInput2:dates[1]},
                        success: function(data){
                            data=eval(data);
                            for(var x in data[0]){
                                //alert(data[0][x]);
                                //fill columns here;
                            }

                            fillPercents(column);
                        }});

现在,这部作品在所有浏览器比Firefox等。萤火表明它越来越答复,回传,但对于一些未知的错误,不显示数据。 可能是什么问题?

now, this works in all browsers, other than Firefox. firebug shows it is getting reply back from post, but for some unknown error, it is not displaying the data. What might be the problem ?

推荐答案

此行​​为是设计使然。

This behavior is by design.

永远不要的使用异步:假
由于Javascript运行UI线程,一个异步的:假请求将冻结浏览器,直到服务器回复

Never use async: false.
Since Javascript runs on the UI thread, an async: false request will freeze the browser until the server replies.

这篇关于jQuery的Ajax和异步假挂起火狐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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