JQUERY IE浏览器的AJAX成功回调不工作 [英] JQUERY IE AJAX Success callback not working

查看:260
本文介绍了JQUERY IE浏览器的AJAX成功回调不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前使用JQ 1.4.2

currently using jq 1.4.2

和我已经通过这个论坛和其他论坛的一个简单的修复不见了......既然有这么多有这样的problem..but我还没有发现任何东西,似乎工作,所以我张贴这个问题

And i have gone through this forum and other forums for a simple fix ... since so many have had this problem..but i have not found anything that seems to work hence i am posting this problem

        $(".editvolunteer").fancybox({
            'width'                : 970,
            'height'            : 460,
            'autoScale'            : false,
            'transitionIn'        : 'none',
            'transitionOut'        : 'none',
            'type'                : 'iframe',
            onClosed : function() {
              $.ajax({
            type: "GET",
            dataType: 'html',
             cache: false, 
               url: "ajaxrosterupdate.php",
            data: "x=60",
              async: false,

        success: function(data) {        

              $("#updateroster").html(data);      <---- this work in FF            

        }
        success: function(resp, txtS, xhr) {
                           if (xhr.status==200) {      

                              alert(xhr.status);    <-- this alert box shows up in ie and FF

                                 } else {

                             //    alert(xhr.status);

                           }
        }

      }).responseText;



    }
       });

我不知道我在做什么错事,但我已经使用debugbar,​​我可以熬了回来我已经使用小提琴手HTML内容,我看到回来有HTML内容....在XHR STAT = 200,使得每一件事情是good..yet它不会取代内容$(#updateroster)。HTML(数据)。

I dont know what i am doing wrong i have used debugbar and i can seethe html content that comes back i have used fiddler and i see the html content that comes back there....the xhr stat =200 so every thing is good..yet it does not replace the the content $("#updateroster").html(data).

我一直在敲打我的头在过去的48小时,以及我需要帮助。

I have been banging my head for the last 48 hrs and well i need help.

推荐答案

的.html( ) 最终使用 .innerHTML 在这里,它的似乎的喜欢的是你的标记回来无效造成了一些问题。

.html() is ultimately using .innerHTML here, what it seems like is your markup coming back is invalid causing some issues.

如果有什么问题的标记和你看到的任何错误,但一个空的结果,很可能是一个浏览器被容忍了无效的HTML,显示出它作为最好是可以的,另一个浏览器可能会完全抛弃它...它似乎什么IE是做给你。

If there's something wrong with the markup and you're seeing no error but an empty result, chances are one browser is tolerating that invalid HTML, showing it as best it can, and another browser may discard it entirely...which appears to be what IE is doing to you.

这篇关于JQUERY IE浏览器的AJAX成功回调不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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