今天用jquery中的ajax替换掉以前的ajax程序
发现ie很多时候都加载不上(空的) firefox可以正常加在
怀疑是ie下加载时间过长而导致错误 里面加载了个discuz模板 还有大片的mysql查询这是我ajax程序 老鸟帮我优化优化 先谢谢了                $.ajax(
                    { 
                        type:"POST",
                        url:that.url_str,//url 地址
                        data:that.str, //发送的数据
                        success:function(html)
                            { 
                                $('#'+that.div_id).html(html);
                                document.getElementById("newDrag").style.display="block";
                                document.getElementById(that.div_id).style.display='block';
                                that.func_name(that.paratmeter);//回调函数
                                that.func_name_other(that.parameter_other);
                            }

解决方案 »

  1.   

    我的做法是设定一个timeout,然后在error:的函数中判断是否已经获得数据,如果没有,重新提交。如果访问量高,慎用!
      

  2.   

    既然用的是jquery 先改下你现在的代码$.ajax(
                        {
                            type:"POST",
                            url:that.url_str,//url 地址
                            data:that.str, //发送的数据
                            success:function(html)
                                {
                                    $('#'+that.div_id).html(html);
                                    $('#newDrag').show();
                                    $('#'+that.div_id).show();
                                    that.func_name(that.paratmeter);//回调函数
                                    that.func_name_other(that.parameter_other);
                                } 你回调函数都没有加载 就 $('#'+that.div_id).html(html);
                                    $('#newDrag').show();
                                    $('#'+that.div_id).show(); 吧这3个放到回调函数出来。 alert一下是什么地方出的问题,应该是还没有加载玩你就先赋值了。