jQuery的Ajax和异步假挂起火狐火狐、挂起、jQuery、Ajax

2023-09-10 13:52:45 作者:抹茶裙摆

我有一个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.

 
精彩推荐
图片推荐